Fix case sensitivity check for StartsWith and EndsWith in StringView

(cherry picked from commit 752e7e73bc)
This commit is contained in:
Wojtek Figat
2021-04-15 16:56:07 +02:00
parent df1dfbec36
commit 801587ab6c

View File

@@ -160,16 +160,16 @@ public:
{
const int32 length = Length();
if (searchCase == StringSearchCase::IgnoreCase)
return length > 0 && _data[0] == c;
return length > 0 && StringUtils::ToLower(_data[0]) == StringUtils::ToLower(c);
return length > 0 && StringUtils::ToLower(_data[0]) == StringUtils::ToLower(c);
return length > 0 && _data[0] == c;
}
bool EndsWith(T c, StringSearchCase searchCase = StringSearchCase::IgnoreCase) const
{
const int32 length = Length();
if (searchCase == StringSearchCase::IgnoreCase)
return length > 0 && _data[length - 1] == c;
return length > 0 && StringUtils::ToLower(_data[length - 1]) == StringUtils::ToLower(c);
return length > 0 && StringUtils::ToLower(_data[length - 1]) == StringUtils::ToLower(c);
return length > 0 && _data[length - 1] == c;
}
bool StartsWith(const StringViewBase& prefix, StringSearchCase searchCase = StringSearchCase::IgnoreCase) const