Bot - How to return a newline from Bot to both skype preview and skype web app

Terry Carter picture Terry Carter · Jul 28, 2016 · Viewed 7k times · Source

I have a Bot app that returns a newline just fine to the Skype preview windows 10 app, using \n\n. However, when I display the message in the web app https://web.skype.com/en/?ecsoverride=developer, it does nor respect the newline breaks and represents it as an ongoing string.

I do not see in the help here: https://docs.botframework.com/en-us/csharp/builder/sdkreference/activities.html ...how to represent a newline regardless of what the client will be - is there some newline that can be used for any client that will receive the message from my bot? If I add something like
it shows as that text in my skype windows 10 app instead of a newline - I'm looking for some newline that works on any client.

Any ideas?

Answer

Artem picture Artem · Nov 27, 2016

Update for 3.5 version putting to string \n\n creates a new paragraph. Like the following:

"Paragraph1_text/n/nParagraph2_text" results in

Paragraph1_text
Paragraph2_text

Older versions

I found out that putting two spaces + NewLine symbol solves the problem(C# code):

return $"some text:  {Environment.NewLine}text from new paragraph" 

Or

return $"some text: \ntext from new paragraph" 

The result is

some text:
text from new paragraph 

This works for both: Microsoft Bot Framework emulator and Skype chat