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
To Lower Case: Transform String CaseInput: "Hello World!"Mixed case stringConvert to LowercaseOutput: "hello world!"All lowercase string
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
Asked in
Google 15 Amazon 12 Microsoft 8
29.6K Views
Medium Frequency
~5 min Avg. Time
956 Likes
Ln 1, Col 1
Smart Actions
💡 Explanation
AI Ready
💡 Suggestion Tab to accept Esc to dismiss
// Output will appear here after running code
Code Editor Closed
Click the red button to reopen