Logo

Programming-Idioms

History of Idiom 49 > diff from v10 to v11

Edit summary for version 11 by :

Version 10

2015-08-22, 21:11:17

Version 11

2015-09-03, 16:25:34

Idiom #49 Split a space-separated string

Build list chunks consisting in substrings of input string s, separated by one or more space characters.

Idiom #49 Split a space-separated string

Build list chunks consisting in substrings of input string s, separated by one or more space characters.

Code
chunks = s.split(" ")
Doc URL
http://ruby-doc.org/core-2.2.3/String.html#method-i-split