这是我的茄子脚本
if iFound does not contain "NULL" then
//replace "\n" by " & return & " in iFound
replace every occurrence of "\n" in iFound with " & return & "
log "before clicking see text" && iFound
log "not null and clicking"
click iFound
End if在这里,我的参数iFound保存了“吉百利奶油蛋\nMcFlurry”
我想替换“吉百利奶油蛋\n麦克弗莱”,比如“吉百利奶油蛋&退货& McFlurry”
因此,我编写了replace命令,但它忽略了转义字符"\n“
replace every occurrence of "\n" in iFound with " & return & "如何将"\n“换行符替换为”& return &“
发布于 2016-08-27 01:10:33
通常,当您在日志窗口或运行窗口中遇到\n或\t字符时,它实际上已经是CRLF或TAB字符。在日志显示中使用\n,因为多行显示在滚动文本中不能很好地工作。
如果将该字符串保存到文件中,您应该会看到这两个字符正确无误。
您还可以在Eggplant --> Preferences --> Run --> Keyboard菜单下为IDE启用转义字符(以便\n被解释为与return相同),作为“启用反斜杠转义代码”复选框。
https://stackoverflow.com/questions/36419176
复制相似问题