我想知道是否可以反转我的输出,以便以相反的顺序(正确)写入字符串?
所以我使用下面的代码来分割一个字符串:
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
- 瓦埃努伊
- 新能源
- ETC...