util/CharUtil: add ToLowerASCII()
This commit is contained in:
@@ -126,4 +126,17 @@ ToUpperASCII(char ch)
|
|||||||
: ch;
|
: ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the specified ASCII character (0x00..0x7f) to lower case.
|
||||||
|
* Unlike toupper(), it ignores the system locale.
|
||||||
|
*/
|
||||||
|
constexpr
|
||||||
|
static inline char
|
||||||
|
ToLowerASCII(char ch)
|
||||||
|
{
|
||||||
|
return ch >= 'A' && ch <= 'Z'
|
||||||
|
? (ch + ('a' - 'A'))
|
||||||
|
: ch;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user