replacing strange quote with standard quote

S

Stimp

I have a function to replace the strange quotes (Chr(8220) and
Chr(8221)) with standard quotes...

e.g. Public Shared Function TextFormat(ByVal InputString As String) As
String

InputString = InputString.Replace(Chr(8220), """")
InputString = InputString.Replace(Chr(8221), """")

TextFormat = InputString
End Function

usage: TextFormat(objRS("Description"))


This compiles fine, but when I run the page I get the following error:

Procedure call or argument is not valid

Line 340: InputString = InputString.Replace(Chr(8220), """")



Any ideas?

Thanks,
Peter
 
G

Guest

Try to use ChrW function instead.
ChrW takes CharCode as a Unicode code point

Public Shared Function TextFormat(ByVal InputString As String) As String


InputString = InputString.Replace(ChrW(8220), """")
InputString = InputString.Replace(ChrW(8221), """")

TextFormat = InputString
End Function
 
S

Stimp

Try to use ChrW function instead.
ChrW takes CharCode as a Unicode code point

Public Shared Function TextFormat(ByVal InputString As String) As String


InputString = InputString.Replace(ChrW(8220), """")
InputString = InputString.Replace(ChrW(8221), """")

TextFormat = InputString
End Function


worked a treat... thanks a million!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top