586.Convert Lowercase Letters to Uppercase
Easy
Given a string
text, return a copy in which every lowercase letter a–z is replaced by its uppercase version. All other characters stay the same.
This exercise shows how characters really work: each one is a number, and in ASCIIASCIIThe standard table that assigns codes 0–127 to English letters, digits, punctuation and control characters. the lowercase alphabet sits exactly 32 codes above the uppercase one. It also introduces immutable stringsImmutable StringA string that cannot be changed after creation; operations return new strings instead.: in Java, Python and JavaScript a converted string is always a new string.
Example 1:
Input: text = "Hello, World 2!"
Output: "HELLO, WORLD 2!"
Example 2:
Input: text = "abc"
Output: "ABC"
+ 4 hidden test cases run on Submit.
Constraints:
- ●
1 ≤ text.length ≤ 200 - ●
text contains printable ASCII characters
text =
Hello, World 2!