Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/utils/string_inject.rb
Overview
Instance Method Summary collapse
-
#unindent ⇒ Object
Strip leading whitespace from each line that is the same as the amount of whitespace on the first line of the string.
Instance Method Details
#unindent ⇒ Object
Strip leading whitespace from each line that is the same as the amount of whitespace on the first line of the string. Leaves additional indentation on later lines intact.
7 8 9 |
# File 'lib/utils/string_inject.rb', line 7 def unindent gsub /^#{self[/\A[ \t]*/]}/, '' end |