Java:如何向后打印此字符串?

时间:2015-10-25 22:59:20

标签: java arrays string

此方法允许我将字符串拆分为单词,但如何将其打印出来?例如字符串“这个问题很难”应该打印“hard is problem this this”

String str = "this problem is hard"
String[] arr = str.split(" ");    
for ( String ss : arr) {
  System.out.println(ss);
}

1 个答案:

答案 0 :(得分:0)

制作字符串后缀。例如,现在你拥有它String str = "this problem is hard"。取而代之的是:String str = "hard is problem this";这就是你需要做的全部。

相关问题