<p>I've just had to write a string reverse function in C# 2.0 (i.e. LINQ not available) and came up with this:</p>

<pre><code>public string Reverse(string text)
{
    char[] cArray = text.ToCharArray();
    string reverse = String.Empty;
    for (int i = cArray.Length - 1; i &gt; -1; i--)
    {
        reverse += cArray[i];
    }
    return reverse;
}
</code></pre>

<p>Personally I'm not crazy about the function and am convinced that there's a better way to do it. Is there?</p>

Have a look at the wikipedia entry
here
. They implement the String.Reverse extension method. This allows you to write code like this:
```
```
string s = "olleh";
s.Reverse();
```
```
They also use the ToCharArray/Reverse combination that other answers to this question suggest. The source code looks like this:
```
```
public static string Reverse(this string input)
{
    char[] chars = input.ToCharArray();
    Array.Reverse(chars);
    return new String(chars);
}
```
```