Code for reversing a string without using reverse function?

Kmandapalli
Posted by Kmandapalli under C# category on | Points: 40 | Views : 576
class ReverseString
{
public static void Main(string[] args)
{
string Name = "Welcome to dotnet funda";
char[] characters = Name.ToCharArray();
StringBuilder sb = new StringBuilder();
for (int i = Name.Length - 1; i >= 0; --i)
{
sb.Append(characters[i]);
}
Console.Write(sb.ToString());
Console.Read();
}
}

Comments or Responses

Login to post response