#include "pch.h" #include "StringUtils.h" std::string StringUtils::trim(const std::string source, const std::string chars) { std::string other(source); auto start = other.find_first_of(chars); auto end = other.find_first_not_of(chars, start); while (start > -1) { other.erase(start, end - start); start = other.find_first_of(chars); end = other.find_first_not_of(chars, start); } return other; } std::string StringUtils::trim(const std::string source) { return trim(source, " \t\n\r"); }