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);
	}
}

posted on 2017-10-26 17:14  MACHINE_001  阅读(66)  评论(0编辑  收藏  举报

导航