51 for (const_iterator iter = begin(); iter != end(); ++iter)
72 if ((newStart = find(oldStr, newStart)) != npos)
74 std::string::replace(newStart, oldStr.size(), newStr);
88 return string(*this).replace(oldStr, newStr, start);
103 while ((newStart = find(oldStr, newStart)) != npos)
105 std::string::replace(newStart, oldStr.size(), newStr);
106 newStart += newStr.size();
116 const string& oldStr,
117 const string& newStr,
121 return string(*this).replaceAll(oldStr, newStr, start);
134 bool changed =
false;
137 iterator iter2 = begin();
139 char cPrev = operator[](0) + 1;
143 string::const_iterator iter1 = iter2;
150 if (c == cPrev && c == character)
178 bool changed =
false;
181 if (n >= 1 &&
operator[](n - 1) == character)
193 string result(*
this);
201 bool changed =
false;
204 if (n >= str.size() &&
operator()(n - nStr, nStr) == str)
216 string result(*
this);
226 while (i0 < size() && str.
count(
operator[](i0)) > 0)
233 while (i1 > i0 && str.
count(
operator[](i1 - 1)) > 0)
243 operator[](i) = operator[](i + i0);
248 if (i0 != 0 || i1 != size())
bool removeRepeated(const char)
Remove repeated characters returning true if string changed.
void strip(const string &)
Strip characters from the start and end of the string.
size_type count(const char) const
Count and return the number of a given character in the string.
string & replaceAll(const string &oldStr, const string &newStr, size_type start=0)
In this string replace all occurrences of sub-string oldStr.
string operator()(const size_type i, const size_type n) const
Return the sub-string from the i-th character for n characters.
const dimensionedScalar c
Speed of light in a vacuum.
static const char *const typeName
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
triSurfaceToAgglom resize(surfacesMesh.size())
graph_traits< Graph >::vertices_size_type size_type
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static const string null
An empty string.
string & replace(const string &oldStr, const string &newStr, size_type start=0)
In this string replace first occurrence of sub-string oldStr.
string & inplaceExpand(string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Inplace expand occurrences of variables according to the mapping.
string & expand(const bool allowEmpty=false)
Expand initial tildes and all occurrences of environment variables.
bool removeTrailing(const char)
Remove trailing character returning true if string changed.
A class for handling character strings derived from std::string.