mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 19:00:17 +02:00
20 lines
397 B
C++
20 lines
397 B
C++
#include "Common/StringUtil.h"
|
|
|
|
namespace FEX::StringUtil {
|
|
void ltrim(fextl::string &s) {
|
|
s.erase(std::find_if(s.begin(), s.end(), [](int ch) {
|
|
return !std::isspace(ch);
|
|
}));
|
|
}
|
|
|
|
void rtrim(fextl::string &s) {
|
|
s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) {
|
|
return !std::isspace(ch);
|
|
}).base(), s.end());
|
|
}
|
|
void trim(fextl::string &s) {
|
|
ltrim(s);
|
|
rtrim(s);
|
|
}
|
|
}
|