To Lower Case
Problem
Given a string s
, return the string after replacing every uppercase letter with the same lowercase letter.
Constraints
1 <= s.length <= 100
s
consists of printable ASCII characters.
Solution
The problem To Lower Case
can be solved by applying tolower
to every characters.
Implementation
static const int fast_io = []()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
return 0;
}();
class Solution
{
public:
string toLowerCase(string s)
{
transform(s.begin(), s.end(), s.begin(), ::tolower);
return s;
}
};