Created
November 19, 2015 17:27
-
-
Save hSATAC/70e8e7a087231520dd22 to your computer and use it in GitHub Desktop.
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
# replace symbols | |
def rs(str) | |
return str if str.blank? | |
symbols = { | |
'>' => '>', | |
'<' => '<', | |
'&' => '&' | |
} | |
result = str | |
for k,v in symbols do | |
result.gsub!(k,v) | |
end | |
return result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment