Str_turn

来源:互联网 发布:哈尔滨软件开发bcweb 编辑:程序博客网 时间:2024/06/03 08:20
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);}}

原创粉丝点击