Skip to content

Instantly share code, notes, and snippets.

@hSATAC
Created Nov 19, 2015
Embed
What would you like to do?
# 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