It depends. Your code returns the trimmed contents of MyTextBox.Text, but it
doesn't actually trim the contents of the textbox. To do that, you would
need to use
MyTextBox.Text = MyTextBox.Text.Trim()
I don't think you need the 'ToString()' bit.
Hope that helps!
"BobM" <nf*@nospam.com> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
I have two strings that I would like to compare. To guarantee the compare
is not affected by trailing spaces, I would like to remove them.
Will this do: MyTextBox.text.ToString().Trim()?