Class: String
Overview
:nodoc:all
Instance Method Summary collapse
- #ends_with(aString) ⇒ Object
- #ensure_end(aString) ⇒ Object
- #lchop ⇒ Object
- #starts_with(aString) ⇒ Object
Instance Method Details
#ends_with(aString) ⇒ Object
40 41 42 |
# File 'lib/zip/stdrubyext.rb', line 40 def ends_with(aString) index(aString, -aString.size) end |
#ensure_end(aString) ⇒ Object
44 45 46 |
# File 'lib/zip/stdrubyext.rb', line 44 def ensure_end(aString) ends_with(aString) ? self : self + aString end |
#lchop ⇒ Object
48 49 50 |
# File 'lib/zip/stdrubyext.rb', line 48 def lchop slice(1, length) end |
#starts_with(aString) ⇒ Object
36 37 38 |
# File 'lib/zip/stdrubyext.rb', line 36 def starts_with(aString) rindex(aString, 0) == 0 end |