Trim zeros from front of string ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there an easy way to trim zeros from the front of a string? The Trim
function will only trim spaces.
 
Val() returns as much of the numerical value from the beginning of a string
as it can (not including any leading zeros).

Val("00123460")
and
Val("1234 60th Avenue")

both return 123460 (as a number).

HTH
 
try cstr(cint("0003450"))

or - safer because it will handle numbers over 65535 and also faster -
cstr(clng("00871243"))

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top