mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
fmt: add some unit tests and fix fmt::trim
This commit is contained in:
parent
376ac85029
commit
68e7f4e820
2 changed files with 158 additions and 4 deletions
|
@ -824,7 +824,12 @@ std::string fmt::trim(const std::string& source, std::string_view values)
|
|||
if (begin == source.npos)
|
||||
return {};
|
||||
|
||||
return source.substr(begin, source.find_last_not_of(values) + 1);
|
||||
const usz end = source.find_last_not_of(values);
|
||||
|
||||
if (end == source.npos)
|
||||
return source.substr(begin);
|
||||
|
||||
return source.substr(begin, end + 1 - begin);
|
||||
}
|
||||
|
||||
std::string fmt::trim_front(const std::string& source, std::string_view values)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue