View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Remove leading zeros from string

El sábado, 13 de octubre de 2018, 6:08:39 (UTC-5), Tatsujin escribió:
Suppose I have a string like this:

"32 01 22 88 03"

I need to remove all the leading zeros in the string. The result should be:

"32 1 22 88 3"

What's the easiest way to go about this? Thanks!

Mr. T


?Replace("32 01 22 88 03", "0", "")


Oops! That's going to replac *ALL* zeros; - the task is to replace *LEADING*
ZEROS ONLY!!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion