32 auto* end = std::remove(s, s + len, c);
38 auto len =
stripChar(&s[0], s.length(), c);
46 for (; len > 0; --len)
48 if (!isspace(s[len - 1]))
54 for (
size_t i = 0; i < s.size(); ++i)
71 auto end = std::unique(
id.begin(),
id.end(), [](
char c1,
char c2) {
72 return ((c1 ==
' ' && c2 ==
' ') || (c1 ==
'\t' && c2 ==
'\t') || (c1 ==
' ' && c2 ==
'\t')
73 || (c1 ==
'\t' && c2 ==
' '));
75 id.resize(end -
id.begin());
76 std::replace(
id.begin(),
id.end(),
'\t',
' ');
std::string & trimBlob(std::string &s)
std::string & cleanseIdentifier(std::string &id)
strips new-line char and collapses multiple white chars.
size_t stripChar(char *s, size_t len, char c)