<p>Given the string "ThisStringHasNoSpacesButItDoesHaveCapitals" what is the best way to add spaces before the capital letters. So the end string would be "This String Has No Spaces But It Does Have Capitals"</p>

<p>Here is my attempt with a RegEx</p>

<pre><code>System.Text.RegularExpressions.Regex.Replace(value, "[A-Z]", " $0")
</code></pre>

What you have works perfectly.  Just remember to reassign
```
value
```
to the return value of this function.
```
```
value = System.Text.RegularExpressions.Regex.Replace(value, "[A-Z]", " $0");
```
```