sources/mystring.h

changeset 183
9b6a0daedfc0
parent 182
20ca0a6be175
child 189
248d0b85cbda
equal deleted inserted replaced
182:20ca0a6be175 183:9b6a0daedfc0
40 using String = std::string; 40 using String = std::string;
41 using StringList = std::vector<std::string>; 41 using StringList = std::vector<std::string>;
42 using namespace std::string_literals; 42 using namespace std::string_literals;
43 43
44 std::string to_lowercase(const std::string& string); 44 std::string to_lowercase(const std::string& string);
45 std::string join_string_list(const StringList& strings, const String& delim); 45 std::string join_string_list(const std::vector<std::string>& strings, const std::string& delim);
46 std::string mid(const std::string& str, int rangeBegin, int rangeEnd); 46 std::string mid(const std::string& str, int rangeBegin, int rangeEnd);
47 std::string right(const std::string& str, int length); 47 std::string right(const std::string& str, int length);
48 std::string vsprintf(const char* formatString, va_list args); 48 std::string vsprintf(const char* formatString, va_list args);
49 std::string __cdecl sprintf(const char* formatString, ...); 49 std::string __cdecl sprintf(const char* formatString, ...);
50 std::string remove_range(const std::string& string, int start, int end); 50 std::string remove_range(const std::string& string, int start, int end);
51 void replace_all(std::string& str, const char* text, const char* replacement); 51 void replace_all(std::string& str, const char* text, const char* replacement);
52 bool starts_with(const std::string& str, const String& other); 52 bool starts_with(const std::string& str, const std::string& other);
53 StringList split(const std::string& string, const String& delimeter); 53 std::vector<std::string> split(const std::string& string, const std::string& delimeter);
54 std::optional<long> to_int(const char* str, int base = 10); 54 std::optional<long> to_int(const char* str, int base = 10);
55 void normalize(std::string& string, int (*filter)(int) = std::isspace); 55 void normalize(std::string& string, int (*filter)(int) = std::isspace);
56 56
57 END_ZFC_NAMESPACE 57 END_ZFC_NAMESPACE

mercurial