?
Solved

Eliminate single quote

Posted on 2006-04-12
7
Medium Priority
?
265 Views
Last Modified: 2010-04-01
Hi,

batchMsg+=" ' " + batchID +" ' "

When I use <%=batchMsg%> it displays the single quote.
How to don't display the single quote?

Thank you.


0
Comment
Question by:mayachoy
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 16442067
batchMsg+=" " + batchID +" "
0
 
LVL 3

Assisted Solution

by:el_dios
el_dios earned 100 total points
ID: 16444372
Hi mayachoy,
> When I use <%=batchMsg%> it displays the single quote.
> How to don't display the single quote?

> Thank you.
do

<%=batchMsg..replaceAll("'", "")%>
You may need a null check....
Cheers!
0
 
LVL 12

Expert Comment

by:jessegivy
ID: 16458989
grrrrrr, can I get a word in edgewise ;)

checking for null always seems liek a good idea!  ...and el_dios, you've got one too many dots in there for the replaceAll call:

<%=batchMsg==null?"":batchMsg.replaceAll("'", "")%>

...I'm confused that you sound confused by this?  You're adding the single quotes to the string using the concatination operator.  When you add those single quotes like that, they become a part of the string.  Why are you quoting the batchID anyway, if it's for query there are NO quotes around integer values, so the first suggestion may not be so bad, but no need to append an empty string at the end?

batchMsg+="" + batchID;

is batchID an integer variable?
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16464168
batchMsg=batchMsg+""+ batchID;

will solve your problem don't Complicate the things.
:-)
0
 
LVL 4

Expert Comment

by:aaaaaa
ID: 16550939
<%=batchID%>
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
Article by: Tammy
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief forma…
Integration Management Part 2
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question