45#ifndef OPENMD_UTILS_TRIM_HPP
46#define OPENMD_UTILS_TRIM_HPP
52namespace OpenMD::Utils {
59 inline void trimLeft(std::string& str,
60 const std::locale& loc = std::locale()) {
61 str.erase(str.begin(),
62 std::find_if(str.begin(), str.end(),
63 [&loc](
auto ch) { return !std::isspace(ch, loc); }));
71 inline void trimRight(std::string& str,
72 const std::locale& loc = std::locale()) {
73 str.erase(std::find_if(str.rbegin(), str.rend(),
74 [&loc](
auto ch) { return !std::isspace(ch, loc); })
84 inline void trim(std::string& str,
const std::locale& loc = std::locale()) {
95 inline std::string trimLeftCopy(std::string str,
96 const std::locale& loc = std::locale()) {
107 inline std::string trimRightCopy(std::string str,
108 const std::locale& loc = std::locale()) {
119 inline std::string trimCopy(std::string str,
120 const std::locale& loc = std::locale()) {