709. To Lower Case】的更多相关文章

题目描述 实现函数 ToLowerCase(),该函数接收一个字符串参数 str,并将该字符串中的大写字母转换成小写字母,之后返回新的字符串. 示例 1: 输入: "Hello" 输出: "hello" 示例 2: 输入: "here" 输出: "here" 示例 3: 输入: "LOVELY" 输出: "lovely" 思路 字符串转char数组,遍历数组,判断如果大写就转小写 代码实…
problem 709. To Lower Case solution1: class Solution { public: string toLowerCase(string str) { string res = ""; for(auto ch:str) { ; res += ch; } return res; } }; solution2: class Solution { public: string toLowerCase(string str) { for(auto &am…
Question 709. To Lower Case Sollution 题目大意:字符串大写转小写 思路: 直接调用Java API函数 字符串转char数组,遍历数组,判断如果大写就转小写 Java实现: public String toLowerCase(String str) { char[] arr = str.toCharArray(); for (int i = 0; i < arr.length; i++) { if (arr[i] >= 'A' && arr…
To Lower Case Description 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"…
题目要求 Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. 题目分析及思路 题目要求返回一个字符串的小写形式.可以直接使用lower()函数.​如果考虑具体的实现逻辑,则将大写字符转成小写字符即可,判断字符是否处在‘A’~‘Z’之间,如果是的话,就把它转成小写字符. python代码​ class Solution: def toL…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述: 题目大意 解题方法 ASIIC码操作 日期 题目地址:https://leetcode.com/problems/to-lower-case/description/ 题目描述: Implement function ToLowerCase() that has a string parameter str, and returns the same string i…
Description 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: In…
Algorithm to-lower-case https://leetcode.com/problems/to-lower-case/ 1)problem Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: "Hello" Output: "hello" Exampl…
题目标签:String 题目让我们把大写字母转换成小写,只要遇到的是大写字母,把它 + 32 变成 小写就可以了. Java Solution: Runtime beats 100.00% 完成日期:07/20/2018 关键词:Ascii code table 关键点:把大写字母 + 32 变成小写 class Solution { public String toLowerCase(String str) { char [] c_arr = str.toCharArray(); for(in…
709. To Lower Case(Easy)# 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"…