题目

Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.

Example 1:

  1. Input: s = "Hello"
  2. Output: "hello"

Example 2:

  1. Input: s = "here"
  2. Output: "here"

Example 3:

  1. Input: s = "LOVELY"
  2. Output: "lovely"

Constraints:

  • 1 <= s.length <= 100
  • s consists of printable ASCII characters.

题意

将字符串转化为全小写。

思路

直接干。


代码实现

Java

  1. class Solution {
  2. public String toLowerCase(String s) {
  3. return s.toLowerCase();
  4. }
  5. }