isnt it suppose to be
 
new String("ryan\"s");
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]On Behalf Of Ryan Meder
Sent: 11 July 2006 03:42
To: [email protected]
Subject: [CTJUG Forum] Re: _javascript_ quotes escape character within escape an escape character

OK the output must look as follows
 
ryan"s
 
The eval method takes a String and I want to create an js String array .
 
So if you make use of the eval method and want it to be an array you would do so as follows for the value "ryan".
 
var value = eval(new String("[\"ryan\"]"));
 
The value of the variable value is equal to an String array containing one element i.e "ryan";
 
The problem comes in when I want to make the value "ryan"s"
Code Looks as follows
var value = eval(new String("[\"ryan"s\"]"));
 
The value after the "n" i.e(The quote) needs to escaped with an escape value i.e "\".
 
But if i make use of the for the quote after "ryan "\" then my inner string will be closed by the quote just after "ryan" which is incorrect.
 
So is there an escape character for a string that can be used once a quote has to be used within an String which contains escape characters already.
 
Thanks alot
 
ryan
 
 
 
 
ie
the output must be

 
On 11/07/06, Java Mad <[EMAIL PROTECTED]> wrote:
you are not clear
do you mean [ryan"s"] or what
how must the output look


Ryan Meder <[EMAIL PROTECTED]> wrote:
Hi Guys.
 
I am making use of the _javascript_ "eval" method i send the method a String that looks like this:
"["ryan"s"]"
 
the value is formatted with escape characters and then looks like this.
 
eval(new String("[\"ryan"s\"]"));
 
The problem that I have is that the value of the quote(") after the "n" of the word "ryan" is within quotes that contain escape characters.
 
So the question is what is the escape character for a quote in a string of a value that sits in between two quotes that already contain escape characters in _javascript_.
 
I hope my question makes sense.
 
Thank you all

--
Regards,

Ryan Meder


Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1ยข/min.



--
Regards,

Ryan Meder

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CTJUG Forum" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---

Reply via email to