1. 程式人生 > >leetcode 709. To Lower Case(水,大寫轉小寫)

leetcode 709. To Lower Case(水,大寫轉小寫)

Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.

Example 1:

Input: “Hello” Output: “hello” Example 2:

Input: “here” Output: “here” Example 3:

Input: “LOVELY” Output: “lovely”

題意:大寫轉小寫

知識點:

  1. toLowerCase()大寫轉小寫
  2. toUpperCase()小寫轉大寫
class Solution
{ public String toLowerCase(String str) { return str.toLowerCase(); } }