博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
翻转单词顺序列,如“student. a am I”,返回的的句子应该是“I am a student.”。
阅读量:4687 次
发布时间:2019-06-09

本文共 533 字,大约阅读时间需要 1 分钟。

import java.util.*;public class Solution {    public String ReverseSentence(String str) {        if(str==null||str.length()==0){            return "";        }if(str.trim().equals("")){            return str;        }        String[] strings = str.split(" ");        List
list = new ArrayList<>(); for(int i = strings.length - 1;i>=0;i--){ list.add(strings[i]); } StringBuffer stringBuffer = new StringBuffer(); for(int i =0;i

 

转载于:https://www.cnblogs.com/q-1993/p/10918090.html

你可能感兴趣的文章
24@Servlet_day03
查看>>
初级ant的学习
查看>>
redis数据结构--String
查看>>
POJ 3279 Fliptile (二进制枚举)
查看>>
memcached 细究(三)
查看>>
future
查看>>
关于main函数传参数的问题
查看>>
getTickCount()函数 VS GetTickCount()函数
查看>>
嵌入式jetty
查看>>
2017~回顾分享
查看>>
let const var的区别与作用
查看>>
计算出线在屏幕内的最长坐标
查看>>
使用svn——项目的目录布局
查看>>
Linux学习之CentOS(二十五)--Linux磁盘管理:LVM逻辑卷基本概念及LVM的工作原理
查看>>
【bzoj4310/hdu5030-跳蚤】后缀数组
查看>>
深度信任网络的快速学习算法(Hinton的论文)
查看>>
RSA System.Security.Cryptography.CryptographicException
查看>>
s的封装和信息隐蔽
查看>>
excelhttp://www.cnblogs.com/caoyuanzhanlang/p/3591904.html
查看>>
ArrayList和LinkedList和Vector源码分析
查看>>