Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/super_strip.rb
Overview
Special version of strip methods to remove special white spaces
Instance Method Summary collapse
- #super_lstrip ⇒ Object
- #super_lstrip! ⇒ Object
- #super_rstrip ⇒ Object
- #super_rstrip! ⇒ Object
- #super_strip ⇒ Object
- #super_strip! ⇒ Object
Instance Method Details
#super_lstrip ⇒ Object
5 6 7 8 9 |
# File 'lib/super_strip.rb', line 5 def super_lstrip split('').drop_while do |point| SuperStrip::WHITE_SPACES.include?(point) end.join end |
#super_lstrip! ⇒ Object
19 20 21 |
# File 'lib/super_strip.rb', line 19 def super_lstrip! do_change(:super_lstrip) end |
#super_rstrip ⇒ Object
11 12 13 |
# File 'lib/super_strip.rb', line 11 def super_rstrip reverse.super_lstrip.reverse end |
#super_rstrip! ⇒ Object
23 24 25 |
# File 'lib/super_strip.rb', line 23 def super_rstrip! do_change(:super_rstrip) end |
#super_strip ⇒ Object
15 16 17 |
# File 'lib/super_strip.rb', line 15 def super_strip super_lstrip.super_rstrip end |
#super_strip! ⇒ Object
27 28 29 |
# File 'lib/super_strip.rb', line 27 def super_strip! do_change(:super_strip) end |