| 19 | } |
| 20 | |
| 21 | std::string trim(const std::string& s, char c) |
| 22 | { |
| 23 | auto b = s.begin(); |
| 24 | auto e = s.end(); |
| 25 | e--; |
| 26 | while(*b == c) b++; |
| 27 | while(*e == c) e--; |
| 28 | if(e++ >= b) return std::string(b, e); |
| 29 | return ""; |
| 30 | } |
| 31 | |
| 32 | std::string lower(const std::string& s) |
| 33 | { |