I want to convert wstring
into lower case. I found that there are a lot of answer using locale info. Is there any function like ToLower()
for wstring
also?
tolower() function in C/C++ But in c++ typecasting is required like this: char c = (char) tolower('A'); Parameter: This method takes a mandatory parameter ch which is the character to be converted to lowercase. Return Value: This function returns the lowercase character corresponding to the ch.
C++ String has got built-in toupper() function to convert the input String to Uppercase.
C# | ToLower() Method. In C#, ToLower() is a string method. It converts every character to lowercase (if there is a lowercase character).
std::towlower
is the function you want, from <cwtype>
. This header contains many functions for dealing with wide strings.
Example:
// Convert wstring to upper case
wstring wstrTest = L"I am a STL wstring";
transform(
wstrTest.begin(), wstrTest.end(),
wstrTest.begin(),
towlower);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With