NewLine替换c#?

use*_*391 6 c# visual-studio windows-phone-7 windows-phone windows-phone-8

我有一个Windows Phone应用程序.在应用程序中,我有一个文本框,其acceptreturn属性设置为true.

我想要做的是从文本框创建一个字符串,并用特定字符替换新行,如 "NL"

我尝试了以下但没有一个工作.

string myString = myTextBox.Text.Replace(Environment.NewLine,"NL");
string myString = myTextBox.Text.Replace("\n","NL");
Run Code Online (Sandbox Code Playgroud)

Tim*_*ter 7

我不熟悉windows phone(或silverlight),但试着\r改为:

string myString = myTextBox.Text.Replace("\r","NL");
Run Code Online (Sandbox Code Playgroud)

为什么Silverlight TextBox使用\ r代替换行而不是Environment.Newline(\ r \n)?