[String] Port changes from S1x
This commit is contained in:
parent
c218aa89ec
commit
5f5f082fdf
@ -23,16 +23,24 @@ namespace Utils
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string ToLower(std::string input)
|
||||
std::string ToLower(std::string text)
|
||||
{
|
||||
std::transform(input.begin(), input.end(), input.begin(), ::tolower);
|
||||
return input;
|
||||
std::transform(text.begin(), text.end(), text.begin(), [](const unsigned char input)
|
||||
{
|
||||
return static_cast<char>(std::tolower(input));
|
||||
});
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
std::string ToUpper(std::string input)
|
||||
std::string ToUpper(std::string text)
|
||||
{
|
||||
std::transform(input.begin(), input.end(), input.begin(), ::toupper);
|
||||
return input;
|
||||
std::transform(text.begin(), text.end(), text.begin(), [](const unsigned char input)
|
||||
{
|
||||
return static_cast<char>(std::toupper(input));
|
||||
});
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
std::string DumpHex(const std::string& data, const std::string& separator)
|
||||
|
@ -75,8 +75,8 @@ namespace Utils
|
||||
const char *VA(const char *fmt, ...);
|
||||
|
||||
int IsSpace(int c);
|
||||
std::string ToLower(std::string input);
|
||||
std::string ToUpper(std::string input);
|
||||
std::string ToLower(std::string text);
|
||||
std::string ToUpper(std::string text);
|
||||
bool EndsWith(const std::string& haystack, const std::string& needle);
|
||||
std::vector<std::string> Split(const std::string& str, const char delim);
|
||||
void Replace(std::string& string, const std::string& find, const std::string& replace);
|
||||
|
Loading…
Reference in New Issue
Block a user