image_2021-11-07_16-32-18.png
27.9 KB
#N709. To Lower Case
problem link
#solution
problem link
#solution
class Solution {
public String toLowerCase(String s) {
char[] res=s.toCharArray();
for(int i=0; i<res.length; i++){
if(res[i]>='A'&&res[i]<='Z')
res[i]=(char)(res[i]+32);
}
return String.valueOf(res);
}
}
or another option, using the String method toLowerCase(), just write return s.toLowerCase(); .