Answers for "how to make a string only lowercase c++"

C++
10

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; 
}
Posted by: Guest on March-27-2021
13

string c++ if letter is lowercase

for(int i=0;i<str.size();i++){
int c = str[i]; 
        if (islower(c))  
            str[i] = toupper(c);
}
Posted by: Guest on April-25-2020

Code answers related to "how to make a string only lowercase c++"

Browse Popular Code Answers by Language