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 also can use the Trim method to remove other characters. The syntax...


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 also can 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). Open the Trim Method Solution (Trim Method Solution.sln) file contained in the VB2010\ Chap08\Trim Method Solution folder. Open the Code Editor window and code the btnTrim control’s Click event procedure. Save the solution and then start and test the application. Close the Code Editor window and then close the solution.

Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here