// cleanWord()
// Requires:  std::string reference
// Returns:   None
// Trims end of line characters, leading spaces, and trailing spaces
// from the passed string reference.  After that, it transforms the
// word to lower case for consistent matching.
void cleanWord(std::string &s) {
  // Small chance of getting empty string, so don't check here every time.
  trimEndOfLine(s);
  trimLeadingWhitespace(s);
  trimTrailingWhitespace(s);
  toLowerString(s);
}
Esempio n. 2
0
std::string trimLeadingWhitespace(const std::string &text)
{
  std::string s = text;
  trimLeadingWhitespace(s);
  return s;
}