mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
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:
parent
f669b5f56f
commit
f0f3e55cc6
3 changed files with 26 additions and 1 deletions
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue