2017-08-01 15 views
1

はそれで「Environment.NewLine」を使用してでフォーマットされた文字列を返す「\ rを\ n」は新しい行が動作しません。適応カードを使用しない方法はありますか?テキストの書式設定

編集: 1.私がテストしていたチャネルは、スカイプ

+0

Skypeのボットでは、あなたはまた、ここでは、両方の一例である'<br/>'

を使用することができます動作しません "? –

+0

Skypeでは動作しません。 – Ash

答えて

1

よりもむしろ'\r\n'ある'\n\n'を試してみてください。

スカイプで
if (length > 0 && activity.Text == "hero") 
{ 
    var reply = ((Activity)context.Activity).CreateReply(string.Empty); 
    reply.Attachments = new List<Attachment>(); 
    var heroCard = new HeroCard() 
     { 
      Text = "1)Hero Card Text\n\n2)next line!\n\n3)and another new line!" 
     }; 
    reply.Attachments.Add(heroCard.ToAttachment()); 
    await context.PostAsync(reply); 
} 
else if (length > 0 && activity.Text == "hero html") 
{ 
    var reply = ((Activity)context.Activity).CreateReply(string.Empty); 
    reply.Attachments = new List<Attachment>(); 
    var heroCard = new HeroCard() 
     { 
      Text = "Hero Card Text <br/>next line!", 
     }; 
    reply.Attachments.Add(heroCard.ToAttachment()); 
    await context.PostAsync(reply); 
} 

と結果:

あなたは「それを使用しているチャネル

enter image description here

+0

ありがとう、これは動作します。 – Ash

関連する問題