Split strings using any of the supplied delimiters. For example: Split("a,b.c,d", ".,") would return {"a", "b", "c", "d"}.
| 119 | // Split strings using any of the supplied delimiters. For example: |
| 120 | // Split("a,b.c,d", ".,") would return {"a", "b", "c", "d"}. |
| 121 | inline std::vector<string> Split(StringPiece text, StringPiece delims) { |
| 122 | return text.empty() ? std::vector<string>() |
| 123 | : absl::StrSplit(text, absl::ByAnyChar(delims)); |
| 124 | } |
| 125 | |
| 126 | template <typename Predicate> |
| 127 | std::vector<string> Split(StringPiece text, StringPiece delims, Predicate p) { |