Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/vbox/cli.rb
Overview
for natural sort order stackoverflow.com/questions/4078906/is-there-a-natural-sort-by-method-for-ruby
Instance Method Summary collapse
Instance Method Details
#naturalized ⇒ Object
8 9 10 |
# File 'lib/vbox/cli.rb', line 8 def naturalized scan(/[^\d]+|\d+/).collect { |f| f.match(/\d+/) ? f.to_i : f } end |