Article ID: 10171
HOWTO:  Trim Leading Zeros in String
HOWTO
Applies To: ITScriptNet V1/V2
Trim leading zeros from a variable-length string
DETAILS

This sample demonstrates how to trim the leading zeros from a variable.

;get the value of the textbox, for example
@var@ = $This.Textbox1$

;Loop through string (textbox value)
FOR(@x@ = 1, @x@ < (Len(@var@)), @x@ = @x@ + 1)
        ;Check for zero
        IF (Mid(@var@,@x@,1) = “0”)
               ;Ignore
        ELSE
               ;Not 0 - return rest of the string and exit loop
               @var@ = Mid(@var@, @x@,Len(@var@)-(@x@ - 1))
               ExitFor
        ENDIF
NEXT

This article last updated: 2/20/2009 10:56:33 AM
Please help us improve the Knowledge Base by rating this article.
    © 1997-2026 Z-Space Technologies - a BCA Innovations Company - All rights reserved