webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Trim leading zeros

    Posted Thu April 03, 2008 12:17 PM

    CAn anyone help me on

    What ever the string I will get I have to remove the leading 0’s of the string and send the remaining string further you got it bayya?

    Example: Input : 00000097983752 Output: 97983752

    000000707 Output: 707

    Thanks in advance!!!


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Trim leading zeros

    Posted Thu April 03, 2008 12:53 PM

    Use addInts service in WmPublic. Add this value to zero and the leading zeros will be trimmed out.

    Cheers
    Guna


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 3.  RE: Trim leading zeros

    Posted Thu April 03, 2008 03:38 PM

    The above solution would work if you are not expecting alphanumeric characters. If you are expecting characters in your input i guess you would have to write a java service which checks for the leading zero and its trims it out.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: Trim leading zeros

    Posted Thu April 03, 2008 05:25 PM

    you can use pub.string:replace service in WmPublic with searchString=^0*
    replaceString=“” and useRegex=true.

    This will work for alphanumeric characters as well.

    ~Sukanta


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB