brgdotnet
asked on
VB.net how to use TrimStart
I have a text box control which accepts numeric numbers as a string. So how can I strip off any leading zeroes before any type of conversion to a numeric?
if someone enters any of the following for example I need to strip off the leading 00s :
"0056"
"06"
I have tried the following but it is not working:
If txtNumInput.Text.Trim = txtNumInput.Text.Trim.Trim Start('0') ' This wont work
If txtNumInput.Text.Trim = txtNumInput.Text.ToString. Trim.TrimS tart('0') ' This also won't work
if someone enters any of the following for example I need to strip off the leading 00s :
"0056"
"06"
I have tried the following but it is not working:
If txtNumInput.Text.Trim = txtNumInput.Text.Trim.Trim
If txtNumInput.Text.Trim = txtNumInput.Text.ToString.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Scott, I met with the team and argued for converting to an integer. All is working well. Thanks for your help.
ASKER