java字母大小写及排序转换

		String str = "aBcD";
		char[] ctr = str.toCharArray();
		String Estr = "";
		String s = "";
		for (int i = ctr.length-1; i >= 0; i--) {
			char c = ctr[i];
			if(Character.isUpperCase(c)){
				s = String.valueOf(c).toLowerCase();
			}else{
				s = String.valueOf(c).toUpperCase();
			}
			Estr = Estr + s;
		}
		System.out.println(Estr);

你可能感兴趣的:(java字母大小写及排序转换)