TF++, Miscellaneous classes and modules in C++:

◆ patsubst()

std::string tfxx::string::patsubst ( const std::string &  s,
const std::string &  p,
const std::string &  r 
)

replace pattern by string

Parameters
sstring that contains pattern
ppattern string
rreplacement for pattern
Returns
string s with all instances of pattern p replaced by r

Definition at line 160 of file stringfunc.cc.

Referenced by main().

163  {
164  std::string retval=s;
165  std::string::size_type n=retval.find(p);
166  while (n !=std::string::npos)
167  {
168  retval.replace(n,p.length(),r);
169  n=retval.find(p,n);
170  }
171  return(retval);
172  }
Here is the caller graph for this function: