Project

unindent

0.04
No commit activity in last 3 years
No release in over 3 years
Ruby method to unindent strings. Useful for multiline strings embeded in already indented code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

 Project Readme

Summary

Simple Ruby method, String#unindent, to unindent strings. Useful for multi-line strings embeded in already indented code.

Examples

class Profile
  def default_text
    <<-STR
      Anonymous Coward
        - Community Guest
    STR
  end
end

puts Profile.new.default_text
#      Anonymous Coward
#        - Community Guest

puts Profile.new.default_text.unindent
#Anonymous Coward
#  - Community Guest

Install

gem install unindent