class String

Add remove indent to the String class

Public Instance Methods

remove_indent() click to toggle source

a helper for writing multi-line strings for error messages example usage

puts <<-HEREDOC.remove_indent
This command does such and such.
    this part is extra indented
HEREDOC

@return [String]

# File lib/ruby_grammar_builder/util.rb, line 26
def remove_indent
    gsub(/^[ \t]{#{match(/^[ \t]*/)[0].length}}/, '')
end