using System;
namespace ajayvishu
{
public class Program
{
public static string Reverse(string x)
{
string result = "";
for (int i = x.Length - 1; i >= 0; i--)
result += x[i];
return result;
}
public static void Main(string[] args)
{
var s=Reverse("hello i am ajay is here");
Console.WriteLine(s);
}
}
}
OR:
var a = "hello i am ajay is here";
char[] arr = a.ToCharArray();
Array.Reverse(arr);
namespace ajayvishu
{
public class Program
{
public static string Reverse(string x)
{
string result = "";
for (int i = x.Length - 1; i >= 0; i--)
result += x[i];
return result;
}
public static void Main(string[] args)
{
var s=Reverse("hello i am ajay is here");
Console.WriteLine(s);
}
}
}
OR:
var a = "hello i am ajay is here";
char[] arr = a.ToCharArray();
Array.Reverse(arr);
0 Comments
if you have any doubts , please let me know