How to TRIM zeroes from the left portion of a string
Posted on 2008-11-10
Classic ASP VBScript
WIN XP Pro
I have a login page for our team where a user enters their employee number. Sometimes, however, they enter their "full" employee number, which just contains 3 leading zeroes ("000.....") before their number.
This, of course, causes problems when logging in because the entered datat does not contain the leading zeroes.
I would like for any zeroes to the left of a number to be ignored, or removed, from the login after the user presses "submit". I was looking at TRIM, LTRIM, RTRIM, but they appear to just remove spaces.
How could I accomplish removing/ignoring zeroes?
Example emp number: 203456
Example login (Sometimes): 000203456
Basically, I would like any number of zeroes (Whether 2 or 5, etc.) to be removed/ignored from the left side until it reaches any number other than zero.
Thanks so much,