I want to replace apostrophe(‘) in a name with “backslash apostrophe” (\’) . But Unfortunately not getting such a simple thing.
So on irb I tried following
x = “stack’s”
x.gsub(/[\’]/,”\'”)
Some how it is not working I am getting same result- stack’s in place of stack\’s
Try this out:
Result: