Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > replacing strange quote with standard quote

Reply
Thread Tools

replacing strange quote with standard quote

 
 
Stimp
Guest
Posts: n/a
 
      09-19-2006
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2VyZ2V5IFp1eWV2?=
Guest
Posts: n/a
 
      09-19-2006
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
--
Programmer


"Stimp" wrote:

> 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
>

 
Reply With Quote
 
 
 
 
Stimp
Guest
Posts: n/a
 
      09-20-2006
On Tue, 19 Sep 2006 Sergey Zuyev <> wrote:
> 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!
--

fiddlewidawiddum
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: neither urllib2.quote nor urllib.quote encode the unicodestrings arguments Valery Khamenya Python 3 10-05-2008 10:16 AM
Re: Problem: neither urllib2.quote nor urllib.quote encode theunicode strings arguments Jerry Hill Python 0 10-03-2008 11:37 PM
Quote-Dot-Quote Operator kvnsmnsn@hotmail.com C++ 6 06-14-2008 11:34 PM
Datagrid on load; replace all double single quote to single quote to display to user Eric Layman ASP .Net 3 04-14-2007 07:16 AM
Single Quote Versus Double Quote In A href link knee-dragger@hotmail.com HTML 3 06-13-2006 12:42 AM



Advertisments