I have a string variable that I define as
String keyRight = new TextRange(rtb_KeyRight.Document.ContentStart, rtb_KeyRight.Document.ContentEnd).Text;
where rtb_KeyRight is a wpf richtextbox
But when I debug my code, the escape sequences \r\n are added to my string.
Doing this does not work:
keyRight.Replace("\r\n", "");
Any ideas?
Basically I’m just extracting the contents of the richtextbox and putting it in a string.
Try: