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 firstname.lastname@example.org. 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.
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.
- Cons of using the whole namespace in C++
- C++ Program that will fill whole memory
- Smallest greater elements in whole array
- ios manipulators uppercase() function in C++
- Conversion of Struct data type to Hex String and vice versa
- What is conversion constructor in C++?
- Advanced C++ | Conversion Operators
- Type Conversion in C++
- Catch block and type conversion in C++
- Data Conversion in C++
- Permutations of a given string using STL
- Counts of distinct consecutive sub-string of length two using C++ STL
- Lexicographic rank of a string using STL
- Remove all consecutive duplicates from a string using STL in C++
- Remove duplicates from a string using STL in C++
- Find and print duplicate words in std::vector<string> using STL functions
- Count number of unique Triangles using STL | Set 1 (Using set)
- Kruskal's Minimum Spanning Tree using STL in C++
- Dijkstra’s shortest path algorithm using set in STL
- Dijkstra's Shortest Path Algorithm using priority_queue of STL