Given a string, convert the whole string to uppercase or lowercase using STL in C++.
For uppercase conversion Input : s = "String" Output : s = "STRING" For lowercase conversion Input : s = "String" Output : s = "string"
Functions used :
transform : Performs a transformation on given array/string.
toupper(int c) : Returns upper case version of character c. If c is already in uppercase, return c itself.
tolower(int c) : Returns lower case version of character c. If c is already in lowercase, return c itself.
JATIN GOYAL jatin goyal
This article is contributed by Jatin Goyal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Conversion of Struct data type to Hex String and vice versa
- Type Conversion in C++
- What is conversion constructor in C++?
- Advanced C++ | Conversion Operators
- Catch block and type conversion in C++
- Find the character in first string that is present at minimum index in second string
- Check if a string can become empty by recursively deleting a given sub-string
- Check if a string can be formed from another string using given constraints
- std::string::append vs std::string::push_back() vs Operator += in C++
- std::string::replace , std::string::replace_if in C++
- std::string::replace_copy(), std::string::replace_copy_if in C++
- std::string::remove_copy(), std::string::remove_copy_if() in C++
- string at() in C++
- std::string::find_first_not_of in C++
- Tokenizing a string in C++