mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
Common: Replace StringBeginsWith/StringEndsWith with std equivalents
Obsoletes these functions in favor of the standard member functions added in C++20.
This commit is contained in:
parent
ba6ee9d7ba
commit
e5b91f00b0
21 changed files with 57 additions and 97 deletions
|
@ -431,16 +431,6 @@ std::string ReplaceAll(std::string result, std::string_view src, std::string_vie
|
|||
return result;
|
||||
}
|
||||
|
||||
bool StringBeginsWith(std::string_view str, std::string_view begin)
|
||||
{
|
||||
return str.size() >= begin.size() && std::equal(begin.begin(), begin.end(), str.begin());
|
||||
}
|
||||
|
||||
bool StringEndsWith(std::string_view str, std::string_view end)
|
||||
{
|
||||
return str.size() >= end.size() && std::equal(end.rbegin(), end.rend(), str.rbegin());
|
||||
}
|
||||
|
||||
void StringPopBackIf(std::string* s, char c)
|
||||
{
|
||||
if (!s->empty() && s->back() == c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue