Answers for "tolower funciton in cpp"

C++
0

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
2

tolower in c++

#include <cctype>
#include <iostream>
#include <cstring>
#include <cstdio>

using namespace std;

int main()
{
    char str[] = "John is from USA.";

    cout << "The lowercase version of \"" << str << "\" is " << endl;

    for (int i=0; i<strlen(str); i++)
        putchar(tolower(str[i]));
    
    return 0;
}
Posted by: Guest on August-24-2020
1

tolower funciton in cpp

transform(s.begin(), s.end(), s.begin(), ::tolower);
Posted by: Guest on April-13-2021

Browse Popular Code Answers by Language