Question

How to find and replace unicode quotation marks in ruby 1.8.7? For example, from:

“Good morning.”

to:

'Good morning.'
Was it helpful?

Solution

You should be able to do normal search and replace, e.g:

>> '“Good morning.”'.gsub(%r/“|”/, "'")
=> "'Good morning.'"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top