1 // sl is the string which is converted to lowercase
2 string sl = "Jatin Goyal";
3
4 // using transform() function and ::tolower in STL
5 transform(sl.begin(), sl.end(), sl.begin(), ::tolower);
1#include<bits/stdc++.h>
2using namespace std;
3main() {
4 string s = "Viet Nam";
5 transform(s.begin(), s.end(), s.begin(), ::tolower); //lowercase
6 cout << s << endl;
7}
8
1int i = 0;
2 while(str[i])
3 {
4 if(str[i] == std::toupper(str[i]) && std::isalpha(str[i]) == 1024)
5 str[i]+= 32;
6 ++i;
7 }