In this lesson, you learned how to use the Trim method to remove space characters from both

Question:

In this lesson, you learned how to use the Trim method to remove space characters from both the beginning and end of a string. You can also use the Trim method to remove other characters. The syntax for doing this is string.Trim[(trimChars)]. The optional trimChars argument is a comma-separated list of characters that you want removed (trimmed). For example, if the txtInput control contains the string “#$456#”, you can remove the number signs and dollar sign from the control’s Text property using the statement txtInput.Text = txtInput.Text.Trim("#"c, "$"c). When processing the Trim method, the computer makes a temporary copy of the string in memory; it then removes the characters in the copy only. Open the VB2015\Chap08\ Trim Method Solution\Trim Method Solution (Trim Method Solution.sln) file. The btnTrim_Click procedure should remove any leading or trailing dollar signs, spaces, or percent signs. Test the application appropriately.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: