M
Martin DeMello
irb(main):001:0> "hello world".sort
=> ["hello world"]
(Because Enumerable#sort calls to_a, and String#to_a = [string])
However this is inconsistent with String#each, and almost certainly
never what the user wants. I'd suggest
String.split($/).sort.join($/).
martin
=> ["hello world"]
(Because Enumerable#sort calls to_a, and String#to_a = [string])
However this is inconsistent with String#each, and almost certainly
never what the user wants. I'd suggest
String.split($/).sort.join($/).
martin