Flash Lite 1.1 子串问题

发布于 2024-09-16 19:20:16 字数 290 浏览 4 评论 0原文

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

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

Could you tell me why both lines print out a?
trace(substring("asd", 0, 1)); // == "a"
trace(substring("asd", 1, 1)); // == "a"
(this prints out s:
trace(substring("asd", 2, 1)); // == "s")

Does in Flash Lite 1.x the index start with 1?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骷髅 2024-09-23 19:20:16

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

Availability
Flash Player 4. This function has been deprecated in favor of String.substr .

Description
String function; extracts part of a string. This function is 1-based, 
whereas the String object methods are 0-based.

Extract from
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary701.html

Availability
Flash Player 4. This function has been deprecated in favor of String.substr .

Description
String function; extracts part of a string. This function is 1-based, 
whereas the String object methods are 0-based.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文