string myText = "Hey bro, what's up?"; //Can also be textBox1.Text for textbox
string reverseText = new string(myText.Reverse().ToArray()); //new string -> Converting char Array to string
//Reverse() => Reversing the array, ToArray() => Converting to array (Since reverse is IEnumerable)
MessageBox.Show(reverseText);
char[] myText = "Hey bro, what's up?".ToCharArray(); //TextBox: textBox1.Text.ToCharArray();
Array.Reverse(myText); //Reversing the Array and storing the new characters in the address of myText
MessageBox.Show(new string(myText)); //Converting it to string
Copyright © 2024, NextGenUpdate.
All Rights Reserved.