public static void main(String[] args) {
String str = "aaaDDDfffEEEE";
String strs = toUpperLowerCaseS(str);
System.out.println(strs);
}
public static String toUpperLowerCaseS(String str) {
char[] ch = str.toCharArray();
for(int i=0;i<ch.length;i++){
if(Character.isLowerCase(ch[i])){
Character.toUpperCase(ch[i]);
}else{
Character.toLowerCase(ch[i]);
}
}
String strs = new String(ch);
return strs;
} |
|