Created
August 11, 2015 05:55
-
-
Save rolandobrown/06acc7704e7716a4e561 to your computer and use it in GitHub Desktop.
Example of gsub & regexp
This file contains 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
def alias | |
# kinda colorful transformations using gsub & regexp | |
@chorus.gsub(/(wu(-|\s)tang\sclan)/i, | |
@name).gsub(/motherfucking slums/i, | |
@switchup).gsub(/fuck/i, | |
@aka).gsub(/busted/i, "trusted") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment