Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: [flasher] Re: String.split()
From: Millie Maruani
Date: Sun, 04 Feb 2001 15:52:43 -0000

thank you Helen.

yes. I used substring, Flash4 way,
disappointed a little.

Millie



----- Original Message -----
From: "Helen Triolo" <designerati-technica [dot] com>
To: "flasher from chinwag" <flasheratlists [dot] chinwag [dot] com>
Sent: Sunday, February 04, 2001 3:26 PM
Subject: [flasher] Re: String.split()


Millie,

As far as I can see, you're right; the last sentence in the manual is
incorrect.

text="hello you";
letter=text.split("");
for (i=0;i<letter.length;i++) {
trace(" letter[" + i + "]: " + letter[i]);
}

returns --> letter[0]: hello you

(not letter[0]: h, letter[1]: e, etc)

and that sure looks like an empty string delimiter to me.

I'm sure you know this already, but you could get every letter into an
array element with this if you want:

nletter = new array();
for (i=0;i<text.length;i++) {
nletter[i] = text.substr(i,1);
trace(" nletter[" + i + "]: " + nletter[i]);
}

Regards,
Helen
-----------------------------------------------------
i-Technica � http://i-technica.com � 301.424.6037
developer resources: http://i-technica.com/whitestuff





[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]