I have a button and a text box on my screen. I am trying to make it so that when I click this "Invert" button the text in the box is cleared and what is currently there is put back in reversed (eg. "cat" would become "tac"). This is my code so far.
private void Ex1InvertButton_Click(object sender, EventArgs e)
{
_FileLinesListString.Reverse();
for (int i = 0; i < _FileLinesListString.Count; i++)
{
Ex1RichTextBox.Text = Ex1RichTextBox.Text + _FileLinesListString + Environment.NewLine;
}
Ex1RichTextBox.Clear();
}
It clears out the text box fine but that's all it does. Reversed text is not appearing. I got this code from an IT professor on my campus and he thinks it should work, despite the obvious. What is going wrong with this code?
private void Ex1InvertButton_Click(object sender, EventArgs e)
{
_FileLinesListString.Reverse();
for (int i = 0; i < _FileLinesListString.Count; i++)
{
Ex1RichTextBox.Text = Ex1RichTextBox.Text + _FileLinesListString + Environment.NewLine;
}
Ex1RichTextBox.Clear();
}
It clears out the text box fine but that's all it does. Reversed text is not appearing. I got this code from an IT professor on my campus and he thinks it should work, despite the obvious. What is going wrong with this code?