mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2026-08-01 12:40:36 +00:00
plutonium sdk support
This commit is contained in:
@@ -140,4 +140,18 @@ namespace utils::string
|
||||
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
std::string trim(const std::string& str, const std::string& whitespace)
|
||||
{
|
||||
const auto first = str.find_first_not_of(whitespace);
|
||||
if (first == std::string::npos)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
const auto last = str.find_last_not_of(whitespace);
|
||||
const auto range = last - first + 1;
|
||||
|
||||
return str.substr(first, range);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user