Extension method: Difference between revisions

Content deleted Content added
Line 26:
public static string Reverse(this string input)
{
char[] reversedCharschars = new char[input.Length]ToCharArray();
Array.Reverse(chars);
for (int i = input.Length - 1, j = 0; i >= 0; --i, j++)
{return new String(chars);
reversedChars[j] = input[i];
}
return new String(reversedChars);
}
}