|
-
Jan 31st, 2003, 11:33 PM
#1
Thread Starter
Addicted Member
how to handle single quotes
Hi all,
I'm fairly new to javascript. Just started to learn today. I'm having an error due to this single quotes. The string I'm passing contains single quotes. What I wanted is to have it 'escaped' so that it will pass the same value. I wanted to retain its original value.
For example, my string contains MEN'S SHOES. I understand that this should be passed as MEN\'S SHOES. But my string is in a variable. I now can get the location of the (') using indexof. The problem is how to insert the backslash.
Please help me.
-
Feb 1st, 2003, 08:59 AM
#2
Frenzied Member
If it's in a variable why do you need to re-escape it? But if you need to split strings up you can use "string".substring(from, to) to get a section of a string.
-
Feb 1st, 2003, 09:39 AM
#3
Conquistador
indexof "'"
double single double ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|