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:
10
src/text.cpp
10
src/text.cpp
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user