Вот значит - на 9 строчке (substr == "push")
Вылетает (9,3): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
private static string ApplyCommands(string[] commands)
{
var builder = new StringBuilder();
foreach (var command in commands)
{
int index = command.IndexOf(' ');
string substr = command.Substring(0, index);
(substr == "push") ? builder.Append(command.Substring(index+1))
: builder.Remove(builder.Length - 1, (int)Char.GetNumericValue(command, index+1));
}
return builder.ToString();
}
push Привет! Это снова я! Пока!
pop 5
push Как твои успехи? Плохо?
push qwertyuiop
push 1234567890
pop 26