mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Update string_format.cpp (#1184)
This commit is contained in:
parent
0dea488e98
commit
6b0f90c321
@ -286,7 +286,7 @@ static const char* whitespace_str = " \t\r\n";
|
||||
std::string trim(std::string_view str) {
|
||||
auto first = str.find_first_not_of(whitespace_str);
|
||||
auto last = str.find_last_not_of(whitespace_str);
|
||||
return std::string{str.substr(first, last - first)};
|
||||
return std::string{str.substr(first, last - first + 1)};
|
||||
}
|
||||
|
||||
std::string trimr(std::string_view str) {
|
||||
@ -296,4 +296,4 @@ std::string trimr(std::string_view str) {
|
||||
|
||||
std::string truncate(std::string_view str, size_t length) {
|
||||
return std::string{str.length() <= length ? str : str.substr(0, length)};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user