如何从一个字符串创建一个字符串数组,例如。
"hello world"将返回 ["hello", "world"]。这需要考虑标点符号等。
可能有一个很好的 RegEx 解决方案,我只是找不到它。
最佳答案
AS3的String.split怎么样?
var text:String = "hello world";
var split:Array = text.split(" "); // this will give you ["hello", "world"]
// then iterate and strip out any redundant punctuation like commas, colons and full stops
关于actionscript-3 - 从字符串创建一个单词数组(字符串),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3118118/