Menu
CoddyTech

To Lower Case

You get a string s. Return a new string in which every uppercase English letter, A to Z, is replaced by its lowercase letter. Every other character, such as a lowercase letter, a digit or a symbol, stays exactly as it is.

Function

toLowerCase(s: string) → string
sstring
the text to convert
Returnsstring
s with every uppercase letter made lowercase

Constraints

  • 1 ≤ s.length ≤ 104
  • Every character of s is an English letter, a digit, or one of the symbols !#$%&()*+-./:;<=>?@[]^_`{|}~.

Examples

Input
s = "Hello-World!"
Output
"hello-world!"
Explanation
The capitals H and W become h and w. The - and the ! are not letters, so they stay where they are.

lock icon+15 hidden tests on Submit

challenge icon

Follow-up

Can you write toUpperCase with the same loop, and explain why one bit of the character code is all that differs between A and a?

Reset code
def toLowerCase(s):
    # Write code here
Test cases

Case 1

Case 2

Case 3

Input

s = "Hello-World!"

Expected

"hello-world!"