Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Split
- From: javascript@xxxxxxxxxx (Peter Brunone)
- Subject: [Javascript] Split
- Date: Wed, 11 Dec 2002 09:08:50 -0800 (PST)
--0-2081321562-1039626530=:72885
Content-Type: text/plain; charset=us-ascii
But he wants to split based on \, not on /.
txt.split("\\") escapes the second \ character, just as
txt.split("\"") escapes the " character so you can split on it... not that you would, but there it is.
As for working in different browsers... ah, that's the joy of web development.
-Peter
Carl Adler <carl@xxxxxxxxxxxxx> wrote:Actually var t=txt.split("\")
> |works for me using Netscape 4.7 and IE 5.1 on the Mac and IE 5.5 on Windows
ME. If "\" was a problem I think that you would use "\/" not "//"
Carl
> From: "Peter Brunone"
> Organization: Your Name Here
> Reply-To: javascript@xxxxxxxxxx
> Date: Tue, 10 Dec 2002 17:40:46 -0600
> To:
> Subject: RE: [Javascript] Split
>
>
> var t=txt.split("\\")
>
> |-----Original Message-----
> |From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On
> |Behalf Of Andrew Gibson
> |Sent: Wednesday, December 11, 2002 4:23 AM
> |To: javascript@xxxxxxxxxx
> |Subject: [Javascript] Split
> |
> |
> |I'm trying to use split to separate out a file name from the complete
> |string.
> |
> |from
> |
> | var txt="C:\Copy\new.html"
> |
> | I want to get "new.html"
> |
> |Whenever I try to use "\" I get a Unterminated String variable error
> | eg var t=txt.split("\")
> |
> |Obviously the problem is in trying to use the "\" character which is an
> |escape char for JScript I beleive. But how can I solve my problem?
> |
> |Andrew
> |
> |
> |_______________________________________________
> |Javascript mailing list
> |Javascript@xxxxxxxxxx
> |https://lists.LaTech.edu/mailman/listinfo/javascript
> |
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
_______________________________________________
Javascript mailing list
Javascript@xxxxxxxxxx
https://lists.LaTech.edu/mailman/listinfo/javascript
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--0-2081321562-1039626530=:72885
Content-Type: text/html; charset=us-ascii
<P>But he wants to split based on \, not on /.
<P>txt.split("\\") escapes the second \ character, just as
<P>txt.split("\"") escapes the " character so you can split on it... not that you would, but there it is.
<P>As for working in different browsers... ah, that's the joy of web development.
<P>-Peter
<P> <B><I>Carl Adler <carl@xxxxxxxxxxxxx></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">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" <PETER@xxxxxxxxxxx><BR>> Organization: Your Name Here<BR>> Reply-To: javascript@xxxxxxxxxx<BR>> Date: Tue, 10 Dec 2002 17:40:46 -0600<BR>> To: <JAVASCRIPT@xxxxxxxxxx><BR>> Subject: RE: [Javascript] Split<BR>> <BR>> <BR>> var t=txt.split("\\")<BR>> <BR>> |-----Original Message-----<BR>> |From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On<BR>> |Behalf Of Andrew Gibson<BR>> |Sent: Wednesday, December 11, 2002 4:23 AM<BR>> |To: javascript@xxxxxxxxxx<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@xxxxxxxxxx<BR>> |https://lists.LaTech.edu/mailman/listinfo/javascript<BR>> |<BR>> _______________________________________________<BR>> Javascript mailing list<BR>> Javascript@xxxxxxxxxx<BR>> https://lists.LaTech.edu/mailman/listinfo/javascript<BR>> <BR><BR>_______________________________________________<BR>Javascript mailing list<BR>Javascript@xxxxxxxxxx<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR><BR><BR></BLOCKQUOTE><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Yahoo! Mail Plus</a> - Powerful. Affordable. <a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Sign up now</a>
--0-2081321562-1039626530=:72885--
- Follow-Ups:
- [Javascript] Split
- From: Carl Adler
- [Javascript] Split
- References:
- [Javascript] Split
- From: Carl Adler
- [Javascript] Split
- Prev by Date: [Javascript] Your Free E mail Books!
- Next by Date: [Javascript] (no subject)
- Previous by thread: [Javascript] Split
- Next by thread: [Javascript] Split
- Index(es):