Guest User

Untitled

a guest
Apr 25th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. entities = [ ''', '"', '&' ]
  2. replace = [ '\'', '"', '&' ]
  3. title = "I'm "testing" this & out!"
  4.  
  5. entities.each do |entity|
  6. replace.each {|x| title.gsub(entity, x)}
  7. end
Add Comment
Please, Sign In to add comment