We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32f3f53 + 88d6717 commit ebcd7a4Copy full SHA for ebcd7a4
csharp/58-Length-of-Last-Word.cs
@@ -0,0 +1,8 @@
1
+public class Solution {
2
+ public int LengthOfLastWord(string s) {
3
+ s = s.TrimEnd();
4
+ string[] arr = s.Split(' ');
5
+ return arr[arr.Length - 1].Length;
6
+ }
7
+}
8
+
0 commit comments