optimized SplitByString function.

This commit is contained in:
2023-01-04 19:22:47 +08:00
parent 8ba8b8aba3
commit d98d81443c

View File

@@ -463,15 +463,25 @@ namespace hgl
*left = str;
if(right)
*right = String<C>();
right->Clear();
}
else
{
if(left)
*left = str.SubString(0, pos);
{
if(pos==0)
left->Clear();
else
*left = str.SubString(0, pos);
}
if(right)
*right = str.SubString(pos + center.Length());
{
if(pos+center.Length()>=str.Length())
right->Clear();
else
*right = str.SubString(pos + center.Length());
}
}
}
}//namespace hgl