Question: I have a parsing question. I have a paragraph which has instances of `:  word`. So basically it has a colon, two spaces, a word (could be anything), then two more spaces. 

So when I have those instances I want to convert the string so I have

1. A new line character after `:` and the word.
2. Removed the double space after the word.
3. Replace all double spaces with new line characters.

Don't know exactly how about to do this. I'm using C# to do this. Bullet point 2 above is what I'm having a hard time doing this.

Thanks

Answer: 
You can try

```
var str = ":  first  :  second  ";
var result = Regex.Replace(str, ":\\s{2}(?<word>[a-zA-Z0-9]+)\\s{2}",
                                                         ":\n${word}\n");

```
Assuming your original string is exactly in the form you described, this will do:

```
var newString = myString.Trim().Replace("  ", "\n");

```

The [`Trim()`](http://msdn.microsoft.com/en-us/library/system.string.trim.aspx) removes leading and trailing whitespaces, taking care of your spaces at the end of the string.

Then, the [`Replace`](http://msdn.microsoft.com/en-us/library/czx8s9ts.aspx) replaces the remaining `" "` two space characters, with a `"\n"` new line character.

The result is assigned to the `newString` variable. This is needed, as `myString` will not change - as strings in .NET are [immutable](http://en.wikipedia.org/wiki/Immutable_object).

I suggest you read up on the [`String`](http://msdn.microsoft.com/en-us/library/s1wwdcbf.aspx) class and all its methods and properties.