#include<bits/stdc++.h>
using namespace std;
main() {
string s = "Viet Nam";
transform(s.begin(), s.end(), s.begin(), ::tolower); //lowercase
cout << s << endl;
}
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string uperCase(string input){
transform(input.begin(), input.end(), input.begin(), ::toupper);
return input;
};
string lowerCase(string input){
transform(input.begin(), input.end(), input.begin(), ::tolower);
return input;
};
int main()
{
string input;
cout <<"Please enter: ";
cin >> input;
cout << "Uper Case: "<<uperCase(input) << endl;
cout << "Lower Case: "<<lowerCase(input) << endl;
}
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
// way 1
string s1 = "HeNrY DeUtScH";
boost::to_lower(s1);
cout << s1 << endl;
// way 2
string s2 = "HeNrY DeUtScH";
transform(s2.begin(), s2.end(), s2.begin(), ::tolower); //lowercase
cout << s2 << endl;
// way 3
string s3 = "HeNrY DeUtScH";
for (int i = 0; i < s3.size(); i++) cout << (char) tolower(s3[i]);
cout << endl;
return 0;
}
char ch = tolower(ch);
// sl is the string which is converted to lowercase
string sl = "Jatin Goyal";
// using transform() function and ::tolower in STL
transform(sl.begin(), sl.end(), sl.begin(), ::tolower);
#include <iostream>
#include <cctype>
using namespace std;
int main() {
// convert 'A' to lowercase
char ch = tolower('A');
cout << ch;
return 0;
}
// Output: a
str[i] = tolower(str[i]);