16 std::string_view delimiters) {
18 std::vector<std::string>
tokens{};
20 std::string::size_type lastPos =
str.find_first_not_of(delimiters, 0);
22 std::string::size_type
pos =
str.find_first_of(delimiters, lastPos);
24 while (std::string::npos !=
pos || std::string::npos != lastPos) {
28 lastPos =
str.find_first_not_of(delimiters,
pos);
30 pos =
str.find_first_of(delimiters, lastPos);
37 std::vector<double> toReturn{};
38 std::transform(strTokens.begin(), strTokens.end(), std::back_inserter(toReturn),
39 [](
const std::string& token){
45 if (
str.empty())
return str;
50 while (
end > 0 && std::isspace(
str[
end])){
58 std::vector<int> toReturn{};
59 std::transform(strTokens.begin(), strTokens.end(), std::back_inserter(toReturn),
60 [](
const std::string& token){
71 if (std::find_if(
str.begin(),
str.end(), [](
const char c){ return std::isspace(c);}) !=
str.end()) {
74 if (spaceFreeStr.size() !=
str.size()) {
79 if (std::from_chars(
str.data(),
str.data() +
str.size(),
number).ec != std::errc{}) {
80 std::stringstream err_except{};
81 err_except<<
"CxxUtils::convertToNumber() - The string '"<<
str<<
"'. Contains unallowed chars";
82 throw std::runtime_error(err_except.str());