FlashLite substringで文字列を抜き出す

substringで文字列を抜き出そうとしてもうまくいかない問題。

substring(string, index, count)

0始まりの場合

num=49;
n1=substring(num,0,1); 	// 4
n2=substring(num,1,1);	// 4

リファレンスをみると0からいけるような感じですが…


1始まりの場合

num=49;
n1=substring(num,1,1); 	// 4
n2=substring(num,2,1);	// 9

インデックスは0からじゃなくて1始まりのようです。

えらいところで時間を取ってしまったけど
これでモバイルの案件をやるたびハマるのも解決!

Filed under Flash Lite1.1, 問題解決メモ · Tagged with

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.