how to turn uppercase to lowercase in c++ code example
Example 1: convert whole string to uppercase c++
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s = "Viet Nam";
transform(s.begin(), s.end(), s.begin(), ::toupper); //uppercase
cout << s << endl;
return 0;
}
Example 2: how to compare lower case character to uppercase cpp
for(int i=0;i<str.size();i++){
int c = str[i];
if (islower(c))
str[i] = toupper(c);
}