Horje
how to change string to lowercase and uperCase in c++ Code Example
convert whole string to lowercase c++
#include<bits/stdc++.h> 
using namespace std; 
main() { 
    string s = "Viet Nam"; 
    transform(s.begin(), s.end(), s.begin(), ::tolower); //lowercase
    cout << s << endl; 
}
convert characters to lowercase c++
str[i] = tolower(str[i]);
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;

}




Cpp

Related
google test assert exception Code Example google test assert exception Code Example
phi function Code Example phi function Code Example
c++ execute thread and forget Code Example c++ execute thread and forget Code Example
nike Code Example nike Code Example
Chef and Races codechef solution in c++ Code Example Chef and Races codechef solution in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8