让我们来练习一下字符串的分割~把话倒过来说:
private void change_button_Click(object sender, EventArgs e) {var after_text = before_TextBox.Text?.Select(x=>x.ToString()).ToArray();string result = "";for (int i = after_text.Length - 1; i >= 0; i--){ result += after_text[i];}after_TextBox.Text = result.ToString(); }
这样更简洁:
after_TextBox.Text = string.Concat(before_TextBox.Text.Reverse());
以后跟朋友聊天就把你想发的文字倒过来发给他吧,就像这样:)