将字符串拆分成一个列表

时间:2013-08-12 11:14:13

标签: string list applescript

如何分割单词的字母。例如。示例使用AppleScript进入{"e","x","a","m","p","l","e"}。我无法添加我尝试的内容,因为我不知道从哪里开始。

1 个答案:

答案 0 :(得分:4)

items of "example" -- {"e", "x", "a", "m", "p", "l", "e"}
characters of "example" -- {"e", "x", "a", "m", "p", "l", "e"}
text 4 thru -1 of "example" -- "mple"

reverse of items of "example" as text -- "elpmaxe"

set text item delimiters to "e"
set ti to text items of "example" -- {"", "xampl", ""}
set text item delimiters to "f"
ti as text -- "fxamplf"