0

你能告诉我为什么这两行都打印出来a吗?
trace(substring("asd", 0, 1)); // == "a"
trace(substring("asd", 1, 1)); // == "a"
打印出来s:)
trace(substring("asd", 2, 1)); // == "s"

Flash Lite 1.x 中的索引是否以 1 开头?

4

1 回答 1

1

摘自 http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary701.html

可用性
Flash Player 4。此函数已被弃用,取而代之的是 String.substr 。

描述
字符串函数;提取字符串的一部分。这个函数是从 1 开始的,
而 String 对象方法是从 0 开始的。
于 2010-08-27T02:43:58.487 回答