![]() |
![]() |
#include "Utilities/General/interface/stringTools.h"
Go to the source code of this file.
Functions | |
int | replace (string &input, const string &gone, const string &it, bool multiple) |
int | replaceRange (string &input, const string &first, const string &last, const string &it, bool multiple) |
void | strip (std::string &input, const std::string &blanks) |
int replaceRange | ( | string & | input, | |
const string & | first, | |||
const string & | last, | |||
const string & | it, | |||
bool | multiple | |||
) |
Definition at line 23 of file stringTools.cc.
00023 { 00024 int n=0; 00025 size_t i = input.find(first,0); 00026 while(i!=string::npos) { 00027 size_t e = input.find(last,i); 00028 if (e!=string::npos) { 00029 n++; 00030 input.replace(i,e+last.size()-i,it); 00031 i = input.find(first,i+(multiple ? 0 : it.size())); 00032 } else break; 00033 } 00034 return n; 00035 }
void strip | ( | std::string & | input, | |
const std::string & | blanks | |||
) |