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;
}
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;
}
how to change string to lowercase and uperCase in c++
#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;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us