Replacing MS Word's quotation marks in VB.NETMon 10 May 2010 Tags: dot net regex vb.net
When dealing with text pasted from Microsoft Word, the presence of "special" (read: non-ASCII) quotation marks and apostrophes can be quite troublesome. Here's a simple way to convert them to "standard" (read: ASCII) quotation marks and apostrophes...
myString = Regex.Replace(myString, "\u201C|\u201D", """") myString = Regex.Replace(myString, "\u2018|\u2019", "'")
Obviously, this doesn't handle all of Word's annoying special characters; but it should get you off on the right foot.