<HTML>
<HEAD>
<TITLE>Re: [Javascript] Split</TITLE>
</HEAD>
<BODY>
I just tested it and \/ works and // does not work.<BR>
Carl<BR>
<BLOCKQUOTE><BR>
<B>From: </B>Peter Brunone <peter_brunone@yahoo.com><BR>
<B>Reply-To: </B>javascript@LaTech.edu<BR>
<B>Date: </B>Wed, 11 Dec 2002 09:08:50 -0800 (PST)<BR>
<B>To: </B>javascript@LaTech.edu<BR>
<B>Subject: </B>Re: [Javascript] Split<BR>
<BR>
</BLOCKQUOTE><BR>
<BLOCKQUOTE><BR>
But he wants to split based on \, not on /. <BR>
<BR>
txt.split("\\") escapes the second \ character, just as <BR>
<BR>
txt.split("\"") escapes the " character so you can split on it... not that you would, but there it is. <BR>
<BR>
As for working in different browsers... ah, that's the joy of web development. <BR>
<BR>
-Peter <BR>
<BR>
<B><I>Carl Adler <carl@carladler.org></I></B> wrote: <BR>
<BLOCKQUOTE>Actually var t=txt.split("\")<BR>
> |works for me using Netscape 4.7 and IE 5.1 on the Mac and IE 5.5 on Windows<BR>
ME. If "\" was a problem I think that you would use "\/" not "//"<BR>
Carl<BR>
<BR>
> From: "Peter Brunone" <BR>
> Organization: Your Name Here<BR>
> Reply-To: javascript@LaTech.edu<BR>
> Date: Tue, 10 Dec 2002 17:40:46 -0600<BR>
> To: <BR>
> Subject: RE: [Javascript] Split<BR>
> <BR>
> <BR>
> var t=txt.split("\\")<BR>
> <BR>
> |-----Original Message-----<BR>
> |From: javascript-admin@LaTech.edu [mailto:javascript-admin@LaTech.edu]On<BR>
> |Behalf Of Andrew Gibson<BR>
> |Sent: Wednesday, December 11, 2002 4:23 AM<BR>
> |To: javascript@LaTech.edu<BR>
> |Subject: [Javascript] Split<BR>
> |<BR>
> |<BR>
> |I'm trying to use split to separate out a file name from the complete<BR>
> |string.<BR>
> |<BR>
> |from<BR>
> |<BR>
> | var txt="C:\Copy\new.html"<BR>
> |<BR>
> | I want to get "new.html"<BR>
> |<BR>
> |Whenever I try to use "\" I get a Unterminated String variable error<BR>
> | eg var t=txt.split("\")<BR>
> |<BR>
> |Obviously the problem is in trying to use the "\" character which is an<BR>
> |escape char for JScript I beleive. But how can I solve my problem?<BR>
> |<BR>
> |Andrew<BR>
> |<BR>
> |<BR>
> |_______________________________________________<BR>
> |Javascript mailing list<BR>
> |Javascript@LaTech.edu<BR>
> |https://lists.LaTech.edu/mailman/listinfo/javascript<BR>
> |<BR>
> _______________________________________________<BR>
> Javascript mailing list<BR>
> Javascript@LaTech.edu<BR>
> https://lists.LaTech.edu/mailman/listinfo/javascript<BR>
> <BR>
<BR>
_______________________________________________<BR>
Javascript mailing list<BR>
Javascript@LaTech.edu<BR>
https://lists.LaTech.edu/mailman/listinfo/javascript<BR>
<BR>
<BR>
</BLOCKQUOTE><BR>
<BR>
<HR ALIGN=CENTER SIZE="1" WIDTH="100%"><BR>
Do you Yahoo!?<BR>
Yahoo! Mail Plus <http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com> - Powerful. Affordable. Sign up now <http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com> <BR>
</BLOCKQUOTE><BR>
</BODY>
</HTML>