Add util::capitalized() and Type::categoryName()

This commit is contained in:
Kamil Śliwak
2023-04-04 17:30:37 +02:00
parent 7b634152bd
commit 293690e5a4
3 changed files with 60 additions and 3 deletions
+9
View File
@@ -160,6 +160,15 @@ inline std::string toLower(std::string _s)
return _s;
}
/// Returns a copy of the string with the first character converted to its uppercase equivalent.
/// Uses the classic "C" locale semantics.
inline std::string capitalized(std::string _s)
{
if (_s.size() > 0)
_s[0] = toUpper(_s[0]);
return _s;
}
/// Checks whether _c is a decimal digit character. It uses the classic "C" locale semantics.
/// @param _c character to be checked
/// @return true if _c is a decimal digit character, false otherwise