package Student;
import java.util.HashMap;
public class Demo2 {
/**
* @param args
*/
public static void main(String[] args) {
String s = "jeigoegjeo124";
char[] c = s.toCharArray();
StringBuffer s1 = new StringBuffer();
for (int i = c.length - 1; i >= 0; i--) {
if(c[i] >= 'a' && c[i] <= 'z'){
s1.append(String.valueOf(c[i]).toUpperCase());
}else if(c[i] >= 'A' && c[i] <= 'Z'){
s1.append(String.valueOf(c[i]).toLowerCase());
}else {
s1.append(c[i]);
}
}
String s3 = s1.toString();
System.out.println(s3);
}
}
|
|