#pragma once #include #include #include #include void replace_all(std::string &str, char from, char to) { for (unsigned int i=0; i < str.length(); i++) { if (str[i] == from) { str[i] = to; } } } std::vector split_string(std::string &str, char delim) { std::stringstream sstream(str); std::vector fields; std::string item; while (std::getline(sstream, item, delim)) { fields.push_back(item); } return fields; } void uppercase_string(std::string &str) { std::transform(str.cbegin(), str.cend(), str.begin(), // write to the same location [](unsigned char c) { return std::toupper(c); }); }