我在想如果可以反轉我的輸出以便字符串按相反順序(正確)寫入?格式化字符串數組以反轉字符串
所以我用下面的代碼,以分割字符串:
String[] capitalArray = revCapitalList.split("\\^");
for (String u: capitalArray) {
System.out.println(u);
}
這是字符串我分裂:
String revCapitalList = "yremogtnom^uaenuj^xineohp^kcor elttil^otnemarcas^revned^droftrah^revod^eessahallat^"
+ "atnalta^ululonoh^esiob^dleifgnirps^silopanaidni^seniom sed^akepot^trofknarf^eguor notab^"
+ "atsugua^silopanna^notsob^gnisnal^luap .ts^noskcaj^ytic nosreffej^aneleh^nlocnil^ytic nosrac^"
+ "drocnoc^notnert^ef atnas^ynabla^hgielar^kcramsib^submuloc^ytic amohalko^melas^grubsirrah^"
+ "ecnedivorp^aibmuloc^erreip^ellivhsan^nitsua^ytic ekal tlas^reileptnom^dnomhcir^aipmylo^notselrahc^nosidam^enneyehc";
輸出:
- yremogtnom
- uaenuj
- xineohp
- 等...
?蒙哥馬利朱諾鳳凰等嗎? 這會有所幫助:http://stackoverflow.com/questions/2441501/reverse-hello-world-in-java – 2013-03-13 01:45:16
確定這是可能的。 – 2013-03-13 01:51:26