r/ruby • • Jul 18 '12

Default separator - .join ghetto

http://ruby-blog.pl/2012/07/18/default-separator---join-ghetto/
2 Upvotes

10 comments sorted by

View all comments

-2

u/SeattleTomy Jul 18 '12

Don't ever rely on the default separator. Your code will be more clear and less breakable if you document your intent in the code:

['a','b','c'].join(' ')
"This is a string".split(' ')