Challenge: Reverse Everything in a String
Complete this hands-on exercise to test your knowledge.
We'll cover the following...
We'll cover the following...
Problem statement
Write a function that takes the given string and returns a new string that contains the same characters in reversed order as the original string. Additionally, the case of each character is also reversed. In other words, if a character is uppercase in the original string, it should be lowercase in the new string, and vice versa.
You must use the forward and reverse iterators to loop over the string.
Note: Use
std::isupperandstd::islowerfrom the C++20 STL to check the case of each character, andstd::toupperandstd::tolowerto change the case of each character.