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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Conversion of Struct data type to Hex String and vice versa
- ios manipulators uppercase() function in C++
- What is conversion constructor in C++?
- Type Conversion 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::crbegin() and std::string::crend() in C++ with Examples
- std::string::remove_copy(), std::string::remove_copy_if() in C++
- std::string::replace_copy(), std::string::replace_copy_if in C++
- std::string::replace , std::string::replace_if in C++
- Periodic Binary String With Minimum Period and a Given Binary String as Subsequence.
- string at() in C++
- std::string::data() in C++
- std::string::insert() in C++
- std::string::compare() in C++
- getline (string) in C++