remove leading zero's

ricky76ricky76 Member Posts: 204
I have some string values that vary in length and i want to delete the leading zero's that are part of the string. However i do not want to delete all the zero's in the string as a zero may be part of the string i need.
Example 1 string 0000345060
Example 2 string 00789

In example 1 i want to return 345060 and in example 2 i would want to return 789. Is there an easy way i can do this?

Comments

  • ta5ta5 Member Posts: 1,164
    Use the delchr function (see help).
    Hope this helps
    Thomas
  • bbrownbbrown Member Posts: 3,268
    ta5 wrote:
    Use the delchr function (see help).
    Hope this helps
    Thomas

    This will delete all occurences, not just the leading ones
    There are no bugs - only undocumented features.
  • AlbertvhAlbertvh Member Posts: 516
    Hi

    use this
    DELCHR(YourString,'<','0');
    



    Albert
  • bbrownbbrown Member Posts: 3,268
    Albertvh wrote:
    Hi

    use this
    DELCHR(YourString,'<','0');
    



    Albert

    That should work. Using DELCHR without the '<' would delete all zeros
    There are no bugs - only undocumented features.
  • ricky76ricky76 Member Posts: 204
    Thanks for your help. Worked lovely.
Sign In or Register to comment.