Skip to content

Instantly share code, notes, and snippets.

@hSATAC
Created November 19, 2015 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hSATAC/70e8e7a087231520dd22 to your computer and use it in GitHub Desktop.
Save hSATAC/70e8e7a087231520dd22 to your computer and use it in GitHub Desktop.
# 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