Question: Visual Basic provides the TrimStart and TrimEnd methods for removing one or more characters from the beginning or end, respectively, of a string. The TrimStart
Visual Basic provides the TrimStart and TrimEnd methods for removing one or more characters from the beginning or end, respectively, of a string. The TrimStart method’s syntax is string.TrimStart[(trimChars)], and the TrimEnd method’s syntax is string.TrimEnd[(trimChars)]. The optional trimChars argument is a commaseparated list of characters that you want removed (trimmed). For example, if the txtSales control contains the string “$56.80”, you can remove the dollar sign from the control’s Text property using the statement txtSales.Text = txtSales. Text.TrimStart("$"c). The default value for the trimChars argument is the space character (" "c). When processing the TrimStart and TrimEnd methods, the computer makes a temporary copy of the string in memory; it then removes the characters from the copy only. Open the VB2015\Chap08\Tax Calculator Solution\Tax Calculator Solution (Tax Calculator Solution.sln) file. The btnCalc_Click procedure should calculate and display the sales tax using the amount entered in the text box and the rate selected in the list box. Be sure to remove any leading dollar signs from the sales amount. Also remove the trailing percent sign from the rate. Test the application appropriately.
Step by Step Solution
3.37 Rating (166 Votes )
There are 3 Steps involved in it
Microsoft Visual Studio Solution File Format Version 1200 Visual Studio 14 VisualStudioVersion 140225120 MinimumVisualStudioVersion 100402191 ProjectF184B08FC81C45F6A57F5ABD9991F28F Tax Calculator Pro... View full answer
Get step-by-step solutions from verified subject matter experts
