| 238 | } |
| 239 | |
| 240 | static inline bool ends_with(const string &s, const string &suffix) |
| 241 | { |
| 242 | if (s.length() < suffix.length()) |
| 243 | return false; |
| 244 | return s.find(suffix, s.length() - suffix.length()) != string::npos; |
| 245 | } |
| 246 | |
| 247 | vector<string> split_string(const string &sep, string s, bool trim = true, |
| 248 | bool accept_empties = false, int nsplits = -1, |