Skip to content

Commit f8f6970

Browse files
committed
#28 - Implement method CppStringT::isnumeric()
Completed.
1 parent b41823b commit f8f6970

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cpp-strings/cppstrings.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,18 @@ namespace pcs // i.e. "pythonic c++ strings"
475475

476476

477477
//--- isnumeric() -------------------------------------
478+
/** \brief Returns true if all characters in the string are numeric characters, and there is at least one character, or false otherwise.
479+
*
480+
* CAUTION: current implementation just returns isdecimal() result,
481+
* while the description of isnumeric() should be this one:
482+
* Numeric characters include digit characters, and all characters
483+
* that have the Unicode numeric value property. Formally, numeric
484+
* characters are those with the property value Numeric_Type=Digit,
485+
* Numeric_Type=Decimal or Numeric_Type=Numeric.
486+
*/
478487
inline const bool isnumeric() const noexcept
479488
{
480-
return false;
489+
return isdecimal();
481490
}
482491

483492

0 commit comments

Comments
 (0)