Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbbb4c8

Browse files
authored
Don't need to pass blank string arg to split
Even more simpler!
1 parent6b1660d commitfbbb4c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎ruby/0058-length-of-last-word.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#simple one liner
55
deflength_of_last_word(s)
6-
s.split(' ').last.length
6+
s.split.last.length
77
end
88

99
#double pointer

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp