faqts : Computers : Programming : Languages : JavaScript : Language Core : Strings

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 24 people (54%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How can I split "Hard Disk/Maxtor/2300.00" in an array with the separator "/" and output myArray[3]

Feb 25th, 2003 03:26
Klaus Bolwin, z - design,


1. you can spit the string by:
var myArray = "Hard Disk/Maxtor/2300.00".split("/");
2. however you can't output myArray[3], since myArray is of length 3 and
- begining with 0 - myArray[2] is the last element.