Question: At the very simplest level all I am trying to do is Data Bind TextBlock control (XAML). Am tying to get string from MyString (property defined in C# code behind) as a Text for TextBlock:

```
DisplayText disp = new DisplayText();
disp.MyString = "Hello";

 public class DisplayText {
       public string MyString {get;set;}
       }

```

XAML code:

```
<TextBlock Grid.Column="1" Text="{Binding Path=MyString}" Foreground="Black"/>

```

But, Its not working:( Am searching for hours but could'nt get this simple thing done. Plz help!

Answer: 
[Searched for a duplicate, but didn't find one about replacing (instead of preventing etc.). If there is one then this one or that one should be *closed*.]

In Emacs, visit the file that has the `^M` chars. Go to the beginning of the file (`M-<`), then:

```
M-x replace-string RET C-q C-m RET RET

```

That is, at the prompt for what to replace, use `Control` + `q` then `Control` + `m`, then `Enter`. At the prompt for what to replace it with, just hit `Enter` (replace it with nothing).
I've been using this

```
(defun delete-carrage-returns ()
  (interactive)
  (save-excursion
    (goto-char 0)
    (while (search-forward "\r" nil :noerror)
      (replace-match ""))))

```

I'm sure there is a better way, but this works well enough that I stopped looking.