Split a string content by whitespaces i.e. ' ', tab.
| 229 | |
| 230 | // Split a string content by whitespaces i.e. ' ', tab. |
| 231 | inline StringVec SplitByWhiteSpaces(const std::string & str) |
| 232 | { |
| 233 | std::stringstream stream(str); |
| 234 | return std::vector<std::string>(std::istream_iterator<std::string>(stream), |
| 235 | std::istream_iterator<std::string>()); |
| 236 | } |
| 237 | |
| 238 | // Find the position of 'search' substring. |
| 239 | // It returns std::string::npos if not found. |
no outgoing calls