leetcode Length of Last Word
2015-06-07 09:52
429 查看
题目链接 这里
错误
输入 “ ”
public class Solution { public int lengthOfLastWord(String s) { if(s==null) { return 0; } String []ss=s.split(" "); if(ss.length!=0) { return ss[ss.length-1].trim().length(); } else { return 0; } } }
错误
输入 “ ”
相关文章推荐
- Milking Time
- Stall Reservations
- Statistics of Recompre…
- Packets
- ACdream的高速公路
- Protecting the Flowers
- Robbers
- hiho一下 第四十九周
- css中的relative(相对位置)和absolute(绝对位置)
- 全面SSH 远程操作与端口转发,远程copy
- dfsd
- 二进制暴力
- NYOJ 47 过河问题
- wamp 中安装cakephp Fatal error: You must enable the intl extension to use CakePHP. in XXX
- ASP.NET中集成百度编辑器UEditor
- C++模板中的静态
- 如何直接访问WEB-INF下列文件
- NGS项目四:高通量测序在植物生物胁迫研究中的应用
- Compiling... ,Error spawning cl.exe 解决方案——VC6环境变量配置
- 设计一个中间件的访问日志组件