This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static string Reverse(string input) { | |
| Stack<char> stack = new Stack<char>(input.ToCharArray()); | |
| StringBuilder sb = new StringBuilder(); | |
| foreach(char c in stack) { | |
| sb.Append(c); | |
| } | |
| return sb.ToString(); | |
| } |