#pragma once #include #include namespace string { bool compare(std::string s1, std::string s2); // std::string upper(std::string s); std::string lower(std::string s); std::string replace(std::string haystack, std::string needle, std::string replacement); std::string replace_all(std::string haystack, std::string needle, std::string replacement); std::string squeeze(std::string haystack, const char &needle); // std::string strip(std::string haystack, const char &needle); std::string strip_trailing_newline(std::string s); std::string trim(std::string haystack, const char &needle); std::string ltrim(std::string haystack, const char &needle); std::string rtrim(std::string haystack, const char &needle); std::string join(const std::vector &strs, std::string delim); std::vector split(std::string s, const char &delim); std::vector &split_into(std::string s, const char &delim, std::vector &elems); std::size_t find_nth(std::string haystack, std::size_t pos, std::string needle, std::size_t nth); }