I am doing string reverse while I have some problem with that. I have added code and O/P below. Please give me the detail explanation for this solution. I am beginner in C#.
CODE
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string str = "ganesh";
- Console.WriteLine(new string(str.Reverse().ToArray()));
- Console.WriteLine(Convert.ToString(str.Reverse().ToArray()));
- Console.WriteLine((str.Reverse().ToArray()).ToString());
- Console.ReadKey();
- }
- }
- }
OUTPUT- hsenag
- System.Char[]
- System.Char[]