473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

replacing strange quote with standard quote

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
Sep 19 '06 #1
2 2190
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
Sep 19 '06 #2
On Tue, 19 Sep 2006 Sergey Zuyev <Se*********@discussions.microsoft.comwrote:
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
Sep 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: vtxr1300 | last post by:
I have a description field where people are putting in all kinds of non html characters. When they're being pulled from the db, they're coming out like • or  or any number of things. Does...
21
by: Kannan | last post by:
Its been a while I have done pure C programming (I was coding in C++). Is the following function valid according to standard C? int main(int argc, char *argv) { int x; x = 9; printf("Value...
32
by: FireHead | last post by:
Hello C World & Fanatics I am trying replace fgets and provide a equavivalant function of BufferedInputReader::readLine. I am calling this readLine function as get_Stream. In the line 4 where...
11
by: VijaKhara | last post by:
Hi all, I just write a very simple codes in C and vthere is a very strange bug which I cannot figure out why. The first loop is for v, and the second for k. There is no relationship between v...
3
by: angelofcaine | last post by:
I would like to place an animated BG on my MySpace page. An animated gif is horrendous on bandwidth (not to mention "hosting" size.) Is there any way to replace it with a FLASH img? (I saw a...
7
by: christery | last post by:
Anyone got a clue to why ther is a T between date and time in the "formatted for sorting" or whatewer they call it, and a Z at the end after seconds- got it fixed for my cobol programmer by...
4
by: kvnsmnsn | last post by:
I'm taking a look at some existing C++ code and trying to figure out what it's doing. It says: static char const *abc = { "DEF", DEF, "GHI", PQR_PQR_STRING "."...
160
by: DiAvOl | last post by:
Hello everyone, Please take a look at the following code: #include <stdio.h> typedef struct person { char name; int age; } Person;
32
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.