CMS 3D CMS Logo

stringTools.h File Reference

#include <string>

Go to the source code of this file.

Classes

class  stringUpdate
 return the new substring. More...

Functions

int replace (std::string &input, const std::string &gone, const std::string &it, bool multiple=false)
 replace "gone" with "it" in "input" if multiple=true reconsider the string after each replacement
int replaceRange (std::string &input, const std::string &first, const std::string &last, const std::string &it, bool multiple=false)
 replace everything between "first" and "last" with "it" in "input" if multiple=true reconsider the string after each replacement
void strip (std::string &input, const std::string &blanks=" \n\t")


Function Documentation

int replace ( std::string &  input,
const std::string &  gone,
const std::string &  it,
bool  multiple = false 
)

replace "gone" with "it" in "input" if multiple=true reconsider the string after each replacement

Referenced by MuonTrackAnalyzer::beginJob(), MuonTrackResidualAnalyzer::beginJob(), MultiTrackValidator::beginRun(), IgWebServiceRegistry::executeURL(), ConfigurationRecord::parse(), RunInfoRead::readData(), KinematicTree::replaceCurrentParticle(), KinematicTree::replaceCurrentVertex(), and replaceWithRegexp().

int replaceRange ( std::string &  input,
const std::string &  first,
const std::string &  last,
const std::string &  it,
bool  multiple = false 
)

replace everything between "first" and "last" with "it" in "input" if multiple=true reconsider the string after each replacement

Referenced by ConfigurationRecord::parse().

void strip ( std::string &  input,
const std::string &  blanks = " \n\t" 
)

Definition at line 16 of file stringTools.cc.

References b, and e.

00016                                                        {
00017   size_t b = input.find_first_not_of(blanks);
00018   if (b==std::string::npos) { input.clear(); return;}
00019   size_t e = input.find_last_not_of(blanks);
00020   input = input.substr(b,e-b+1);
00021 }


Generated on Tue Jun 9 17:56:01 2009 for CMSSW by  doxygen 1.5.4