Posted By

CaptainProton on 05/08/10


Tagged

character String zero


Versions (?)

stripZeros(String) As String


 / Published in: Visual Basic
 

This function removes all leading zeros at the beginning of a string.

  1. Private Function stripZeros(str As String) As String
  2. If (Left(str, 1) = "0" And Len(str) > 1) Then
  3. stripZeros = stripZeros(Mid(str, 2))
  4. Else
  5. stripZeros = str
  6. End If
  7. End Function

Report this snippet  

You need to login to post a comment.