Reversing a string in c# is a three step process.
Step 1 :- First convert the string to a char array.
string str = ” .NET interview questions with answers “;
char[] Array1 = str.ToArray(); // Step 1 :- Convert to a Array
Step 2 :- Call the reverse method of the array.
Array.Reverse(Array1); // Step 2 :- call the reverse method
Step 3 :- Convert the reversed array back to string
string strrev = new string(Array1); // Step 3:- Convert the same back to a string
Below goes the complete code for the same.
string str = “c# interview questions with answers”;
char[] Array1 = str.ToArray(); // Step 1 :- Convert to a Array
Array.Reverse(Array1); // Step 2 :- call the reverse method
string strrev = new string(Array1); // Step 3:- Convert the same back to a string
Console.WriteLine(strrev);
This is a nice blog which has a nice collection of real time c# interview questions and answers.
We are also thankful to Mr Shivprasad Koirala and Bpb publication to print such a awesome book c# interview questions and answers









