Hello,
I am using Stata18. I am attempting to merge with string variables. However, some of the string variables in my master data have curly quotation marks like ” or like ’. I cannot replace them directly in my do file as when I tried to replace them, it appears directly " instead of ” even I copy the ” directly.
Then, I am trying different solutions but none of them have worked. Here are some of the attempts I made:
First solution:
Second solution:
These attempts resulted in errors of invalid syntax or did not have any effect. Any alternative to deal with this issue?
Thank you.
I am using Stata18. I am attempting to merge with string variables. However, some of the string variables in my master data have curly quotation marks like ” or like ’. I cannot replace them directly in my do file as when I tried to replace them, it appears directly " instead of ” even I copy the ” directly.
Then, I am trying different solutions but none of them have worked. Here are some of the attempts I made:
First solution:
Code:
replace language_name = subinstr(language_name, "\u201D", `"\""', .)
Second solution:
Code:
local quote "\"" replace language_name = subinstr(language_name, "\u201D", "`quote'", .)
Thank you.
Comment