【发布时间】:2021-10-16 21:17:45
【问题描述】:
因此,在 Javascript 中,您可以按照以下方式编写一些内容:
let array = "This.should.be.an.array";
array = array.split(".");
console.log(array)
/* This,should,be,an,array */
现在我知道在 Applescript 中有:
set theText to "This should be a list"
set theList to every word of theText
return theList
{"This", "should", "be", "a", "list"}
还有:
set theText to "This
should
be
a
list"
set theList to every paragraph of theText
return theList
{"This", "should", "be", "a", "list"}
还有:
set theText to "Thisshouldbealist"
set theList to every character of theText
return theList
{"T", "h", "i", "s", "s", "h", "o", "u", "l", "d", "b", "e", "a", "l", "i", "s", "t"}
但我不知道如何拆分列表,例如单词之间的句点。
【问题讨论】:
标签: javascript arrays applescript