rpackages/ms2Spectrum/src/utils.cpp
void utils::split (const std::string& str, const char delim, std::vector<std::string>& elems)
{
  elems.clear();
  std::stringstream ss (str);
  std::string item;

  while(getline(ss, item, delim)) {
    elems.push_back(item);
  }
}
//split str by delim and populate each split into elems
split str by delim and populate each split into elems
split str by delim and populate each split into elems
void utils::split (const std::string& str, const char delim, std::vector<std::string>& elems)
{
  elems.clear();
  std::stringstream ss (str);
  std::string item;
  while(getline(ss, item, delim)) {
    elems.push_back(item);
  }
}
void utils :: split ( const std :: string & str , const char delim , std :: vector < std :: string > & elems ) { elems . clear ( ) ; std :: stringstream ss ( str ) ; std :: string item ; while ( getline ( ss , item , delim ) ) { elems . push_back ( item ) ; } }
split str by delim and populate each split into elems
split str by delim and populate each split into elems