class Program()
{
static void Main()
{
string str = "this is a string";
char[] charArr = str.ToCharArray();
StringBuilder build = new StringBuilder();
for (int i = charArr.lenght-1; i >=0; i--)
{
build.Append(charArr[i]);
}
Console.WriteLine(build.ToString());
Console.ReadKey();
}
}
{
static void Main()
{
string str = "this is a string";
char[] charArr = str.ToCharArray();
StringBuilder build = new StringBuilder();
for (int i = charArr.lenght-1; i >=0; i--)
{
build.Append(charArr[i]);
}
Console.WriteLine(build.ToString());
Console.ReadKey();
}
}
No comments:
Post a Comment