1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 07:25:07 +00:00

AK: Add StringView::substring_view(size_t) overload.

This commit is contained in:
asynts 2020-09-19 15:19:34 +02:00 committed by Andreas Kling
parent b7bd2ed9d2
commit d831b5738d
2 changed files with 6 additions and 0 deletions

View file

@ -193,6 +193,11 @@ StringView StringView::substring_view(size_t start, size_t length) const
ASSERT(start + length <= m_length);
return { m_characters + start, length };
}
StringView StringView::substring_view(size_t start) const
{
ASSERT(start <= m_length);
return { m_characters + start, length() - start };
}
StringView StringView::substring_view_starting_from_substring(const StringView& substring) const
{