Microsoft Bot Framework - 提示中的新行
Microsoft Bot Framework - New line in prompts
如何在提示中添加新行?
session.send('This is line 1. This is line 2.');
我希望输出如下所示:
This is line 1.
This is line 2.
但我得到的输出是:
This is line 1. This is line 2.
我尝试使用 \n
、\r\n
和 os.EOL
,但其中 none 有效。是否可以在提示中添加新行?
您应该尝试使用 \n\n
。
嗯,这取决于
single quotes ' '
double quotes " "
如果使用双引号,则必须使用\n\n
和
如果使用单引号,则必须使用<br/>
示例,
session.send('This is Line 1 <br/>This is Line 2<br/>');
session.send("This is line 1\n\n This is line 2\n\n");
如何在提示中添加新行?
session.send('This is line 1. This is line 2.');
我希望输出如下所示:
This is line 1.
This is line 2.
但我得到的输出是:
This is line 1. This is line 2.
我尝试使用 \n
、\r\n
和 os.EOL
,但其中 none 有效。是否可以在提示中添加新行?
您应该尝试使用 \n\n
。
嗯,这取决于
single quotes ' '
double quotes " "
如果使用双引号,则必须使用\n\n
和
如果使用单引号,则必须使用<br/>
示例,
session.send('This is Line 1 <br/>This is Line 2<br/>');
session.send("This is line 1\n\n This is line 2\n\n");