For an array, there is a nice sort method to change the sequence of elements. I want to achieve the same results for a string.
For example, I have a string str = "String" , I want to sort it alphabetically with one simple method to "ginrSt" .
Is there my own way to enable this, or should I include mixins from Enumerable ?
string sorting ruby
steveyang Feb 27 '12 at 11:16 2012-02-27 11:16
source share