其他分享
首页 > 其他分享> > LeetCode-709. 转换成小写字母(简单)

LeetCode-709. 转换成小写字母(简单)

作者:互联网

709. 转换成小写字母

给你一个字符串 s ,将该字符串中的大写字母转换成相同的小写字母,返回新的字符串。
示例 1:

输入:s = "Hello"
输出:"hello"

代码:

class Solution {
public:
    string toLowerCase(string s) {
        for (auto &c : s) {
            c = tolower(c);
        }
        return s;
    }
};

标签:转换成,string,示例,小写字母,字符串,LeetCode,709
来源: https://blog.csdn.net/m0_38128647/article/details/121889979