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?

12 of 23 people (52%) answered Yes
Recently 4 of 10 people (40%) 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.