mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-07 01:00:17 +02:00
21 lines
429 B
C++
21 lines
429 B
C++
// SPDX-License-Identifier: MIT
|
|
#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);
|
|
}
|
|
}
|