feat(string): add functions to categorize strings

This commit is contained in:
2024-11-10 19:24:40 +08:00
parent 7a80a80a12
commit 09bbcecc28
4 changed files with 83 additions and 2 deletions

View File

@ -1019,6 +1019,32 @@ public:
return AsConst(*this).GetData();
}
public:
/** @return true if the string only contains valid characters, false otherwise. */
NODISCARD FORCEINLINE constexpr bool IsValid() const
{
return TStringView<ElementType>(*this).IsValid();
}
/** @return true if the string only contains ASCII characters, false otherwise. */
NODISCARD FORCEINLINE constexpr bool IsASCII() const
{
return TStringView<ElementType>(*this).IsASCII();
}
/** @return true if the string only contains numeric characters, false otherwise. */
NODISCARD FORCEINLINE constexpr bool IsNumeric() const
{
return TStringView<ElementType>(*this).IsNumeric();
}
/** @return true if the string only contains numeric characters, false otherwise. */
NODISCARD FORCEINLINE constexpr bool IsNumeric(unsigned Base) const
{
return TStringView<ElementType>(*this).IsNumeric(Base);
}
public:
/**