Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove leading zeros in a text string? 2

Status
Not open for further replies.

legos

Programmer
Joined
Jul 2, 2003
Messages
151
Location
US
say i have a string of text with several leading zeros.
exp.
000012345

i want to convert this to an integer using the Cint command. But it will not work unless i remove the zeros. Basically i'd like to use something like the Ltrim function, but with it removing zeros instead of spaces.

Durible Outer Casing to Prevent Fall-Apart
 
You might try

OldStr = "0000012345"
NewStr = Trim(Val(OldStr))

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
that works perfectly!!! thanks alot

Durible Outer Casing to Prevent Fall-Apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top