标签:
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();
}
}
标签:
原文地址:http://blog.csdn.net/wj512416359/article/details/42243405