如何删除 ActionScript 中以特殊字符(或单词)开头的部分字符串?
所以我有一个字符串“bla dla dla vre bla 54312”我想通过说类似的话将其变成“bla dla dla” 函数(字符串,“vre”); 怎么做这样的事情?
so I have a string "bla dla dla vre bla 54312" I want to turn it into "bla dla dla " by saying something like
function(string, "vre");
how to do such thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我确信您知道如何围绕此编写函数,但这就是您真正需要做的事情。查看 liveDocs 以获取有关 subString 和 indexOf 方法的详细信息。
I'm sure you know how to write the function around this, but this is all you really need to do what you're asking. Check out the liveDocs for details about the subString and indexOf methods.
这可能会帮助您开始:
This might get you started:
我不熟悉动作脚本语法,但这似乎相当简单。你可以尝试:
我可能有一些语法错误,但基本概念仍然清晰。
I'm not familiar with actionscript syntax, but this seems like it'd be fairly easy. You could try:
I may've gotten some syntax wrong, but the basic concept still comes through.