我想在Applescript中替换"\n".每当我写下它时,它只会将后面的内容\n带到下一行.我怎么做?
set newVar to my replaceText("\n/blah-blah", "")
Run Code Online (Sandbox Code Playgroud)
编辑:
set newVar to my replaceText(linefeed, "", newVar)
log newVar
Run Code Online (Sandbox Code Playgroud)
newVar仍然打印\n到最后.
这应该抓住他们所有:
set oldText to "line 1
line 2
line 3"
set AppleScript's text item delimiters to {return & linefeed, return, linefeed, character id 8233, character id 8232}
set newText to text items of oldText
set AppleScript's text item delimiters to {" "}
set newText to newText as text
Run Code Online (Sandbox Code Playgroud)
使用"blah \n"作为oldText
| 归档时间: |
|
| 查看次数: |
11207 次 |
| 最近记录: |