| Below is the function to reverse a given string with the help of array
public static string Reversestring(string StrVal)
{
int len = StrVal.Length;
StringBuilder revStr = new StringBuilder();
for (int i = len - 1; i >= 0; i--)
{
revStr.Append(StrVal[i]);
if (i != 0)
{
revStr.Append('X');
}
}
return revStr.ToString();
} | | |