Leetcode之0709, 修改字符串

 1 class Solution {
 2 public:
 3     string toLowerCase(string s) {
 4         for(char &ch: s){
 5             if(ch>='A' && ch<='Z'){
 6                 ch=tolower(ch);
 7             }
 8         }
 9         return s;
10     }
11 };

 

posted @ 2023-07-20 00:49  安然春夏  阅读(8)  评论(0)    收藏  举报