Method: String#rotate!
- Defined in:
- lib/core/facets/string/rotate.rb
#rotate!(count = 1) ⇒ Object
Destructive version of String#rotate
s='abcdefgh'
s.rotate!(2)
s.should eq 'cdefghab'
CREDIT: T. Yamada
22 |
# File 'lib/core/facets/string/rotate.rb', line 22 def rotate!(count=1) replace(rotate(count)) end |