var str = new StringBuilder(); while (stack.Count > 0) { str.Append(c); } string final = new string(str.ToString().Reverse().ToArray());