Created
August 16, 2011 12:49
-
-
Save kenzie/1148995 to your computer and use it in GitHub Desktop.
Add an indent method to String.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
# adds tabs to the beginning of each line | |
def indent(tabs=4) | |
self.gsub(/^/, "\t"*tabs) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment