Molecular Dynamics Simulation  1.0
StringUtils.cpp
Go to the documentation of this file.
1 #include "StringUtils.h"
2 
3 std::vector<std::string> split(const std::string& s, const std::string& delimiter) {
4  std::vector<std::string> tokens;
5 
6  size_t start = 0;
7  size_t end = s.find(delimiter);
8 
9  while (end != std::string::npos) {
10  tokens.push_back(s.substr(start, end - start));
11  start = end + delimiter.size();
12  end = s.find(delimiter, start);
13  }
14 
15  tokens.push_back(s.substr(start, end));
16 
17  return tokens;
18 }
std::vector< std::string > split(const std::string &s, const std::string &delimiter)
Definition: StringUtils.cpp:3