To Lower Case - Problem
Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.
Input & Output
Example 1 — Mixed Case
$
Input:
s = "Hello"
›
Output:
"hello"
💡 Note:
The uppercase 'H' is converted to lowercase 'h', while other characters remain unchanged.
Example 2 — All Uppercase
$
Input:
s = "HERE"
›
Output:
"here"
💡 Note:
All uppercase letters H, E, R, E are converted to their lowercase equivalents h, e, r, e.
Example 3 — Already Lowercase
$
Input:
s = "lovely"
›
Output:
"lovely"
💡 Note:
String is already lowercase, so no changes are made.
Constraints
- 1 ≤ s.length ≤ 100
- s consists of printable ASCII characters.
Visualization
Tap to expand
Understanding the Visualization
1
Input
String with uppercase and lowercase letters
2
Process
Convert all uppercase letters to lowercase
3
Output
String with all letters in lowercase
Key Takeaway
🎯 Key Insight: Use built-in string methods for simple and efficient case conversion
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code