We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4eeab47 commit b695b8cCopy full SHA for b695b8c
solution/0058.Length of Last Word/Solution.java
@@ -0,0 +1,6 @@
1
+class Solution {
2
+ public int lengthOfLastWord(String s) {
3
+ s = s.trim();
4
+ return s.length()-s.lastIndexOf(" ")-1;
5
+ }
6
+}
0 commit comments