How to replace an unicode quotation marks with an ascii in ruby 1.8?
-
12-06-2021 - |
Question
How to find and replace unicode quotation marks in ruby 1.8.7? For example, from:
“Good morning.”
to:
'Good morning.'
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