您的位置:首页 > 其它

字符串反转变形(asd zxc qwe -> qwe zxc asd)

2020-04-05 18:25 357 查看
1 public String reverse(String str){
2     String s = "";
3     String[] strings = str.split(" ");
4     for (int i = strings.length - 1; i > 0 && i<strings.length ; i--) {
5         s = strings[i] + " ";
6     }
7     return s;
8 }

asd zxc qwe -> qwe zxc asd

转载于:https://www.cnblogs.com/carry6/p/11520312.html

  • 点赞
  • 收藏
  • 分享
  • 文章举报
diexi0099 发布了0 篇原创文章 · 获赞 0 · 访问量 284 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: