Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-12 22:40:36

0001 #include "SimG4CMS/Calo/interface/CaloSimUtils.h"
0002 
0003 std::vector<std::string> CaloSimUtils::splitString(const std::string& fLine) {
0004   std::vector<std::string> result;
0005   int start = 0;
0006   bool empty = true;
0007   for (unsigned i = 0; i <= fLine.size(); i++) {
0008     if (fLine[i] == ' ' || i == fLine.size()) {
0009       if (!empty) {
0010         std::string item(fLine, start, i - start);
0011         result.emplace_back(item);
0012         empty = true;
0013       }
0014       start = i + 1;
0015     } else {
0016       if (empty)
0017         empty = false;
0018     }
0019   }
0020   return result;
0021 }