You cannot use the Reverse extension method, since Reverse() returns an IEnumerable<char> , which is not a char[] . You must pass an IEnumerable<char> to the array. So this works, for example:
char[] c = mijnVoornaam.Reverse().ToArray();
You can use Reverse in string too with this extension method:
public static class ExtensionMethods { public static string Reverse(this string s) { return string.Concat(s.Reverse());
Then just call:
string reverse = "name".Reverse();
source share