Text Handling

- Implemented nontrivial (), which detemines whether a string contains
  any non-space characters.  Used to detect strings with no content.
This commit is contained in:
Paul Beckingham 2011-05-23 20:08:33 -04:00
parent f669b5f56f
commit f0f3e55cc6
3 changed files with 26 additions and 1 deletions

View file

@ -481,6 +481,16 @@ void guess (
}
}
////////////////////////////////////////////////////////////////////////////////
bool nontrivial (const std::string& input)
{
for (size_t i = 0; i < input.length (); ++i)
if (!isspace (input[i]))
return true;
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool digitsOnly (const std::string& input)
{