Str_turn

public class Str_turn
{
	public static void main(String args[])
	{
		String Str1 = new String("This is a book.");
		char temp[]=Str1.toCharArray();
		temp[temp.length-2]-=32;
		if(temp[0]<91) temp[0]+=32;
		String Str2 ="";
		for(int i=temp.length-2; i>=0; i--)
			Str2+=temp[i];
		Str2+=temp[temp.length-1];
		System.out.println(Str2);
	}
}

原文地址:https://www.cnblogs.com/WALLACE-S-BOOK/p/9732361.html