在字符串中引入“”我不确定如何执行以下操作:
my_string = "Hello
\!"\!"
World!";
my_string = substitute(my_string , "\!"", """"); // This returns an error
// Expected
// "Hello
// ""
// World!"
脚本编写回复:在字符串中引入“”您想把弦放在哪里?
在JSL中,需要转义的双引号(\!“)才能让JMP知道字符串的开始和结束位置。
但是,如果您在窗口或其他地方显示该字符串,则就像您想要的那样。
names default to here(1);
clear log();
my_string = "\[Hello
""
World!]\";
show(my_string);
New Window( "String output window",
Text Box( my_string);
);
// Expected
// "Hello
// ""
// World!"
回复:在字符串中引入“”对不起我忘记了,
您可以使用函数写入功能来完成您想要的操作。
write(my_string);
回复:在字符串中引入“”是的,write(...)比print(...)混乱得多。 Print添加引号使打印对于打印字符串几乎没有用,除非您计划将它们从日志中复制/粘贴回更多的JSL,在这种情况下,添加引号之间的所有转义都是有用的。
回复:在字符串中引入“”想法是编写此字符串,以便JMP自动生成txt文件。
回复:在字符串中引入“”如果我需要在字符串中使用双引号,请使用转义序列\ [your-string-goes-here] \。
例如:
my_string = "\[Hello
""
World!]\";
write(my_string);
输出:
Hello
""
World!