1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Added String.Split

This commit is contained in:
Brian Fiete 2019-10-23 07:12:49 -07:00
parent 3883a3674d
commit 2693dbfaca
2 changed files with 215 additions and 1 deletions

View file

@ -109,6 +109,11 @@ void StringView::ToString(StringImpl& str) const
str.Append(mPtr, mLength);
}
StringSplitEnumerator StringView::Split(char c)
{
return StringSplitEnumerator(mPtr, mLength, c, 0x7FFFFFFF, false);
}
//////////////////////////////////////////////////////////////////////////
String Beefy::operator+(const StringImpl& lhs, const StringImpl& rhs)
@ -492,6 +497,11 @@ void StringImpl::RemoveToEnd(intptr startIdx)
Remove(startIdx, mLength - startIdx);
}
void StringImpl::RemoveFromEnd(intptr length)
{
Remove(mLength - length, length);
}
void StringImpl::Insert(intptr idx, const char* str, intptr length)
{
BF_ASSERT(idx >= 0);