标签:
public class Solution { public int lengthOfLastWord(String s) { if (s.trim().length() == 0) { return 0; } String[] str = s.split(" "); return str[str.length - 1].length(); } }
LeetCode--Length of Last Word
原文地址:http://blog.csdn.net/wj512416359/article/details/42243405