IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.  Substringing a variable length string

    Posted Thu September 30, 2004 06:39 PM

    Hi,

    I have an element whose content is a string which varies in size. Examples - The string could look like Stocks 12% of Posts or Micellaneous Assets 14% of Posts. So the only thing in common is the percentage sign and the text after this. However I only want to display the text before the percentage value ie in these cases I only want to show Stocks and Micellaneous Assets. How could i split up the element to do this?

    Thanks


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: Substringing a variable length string

    Posted Fri October 01, 2004 10:36 AM

    How about the following?




    Try to use XML as opposed to “data strings”.


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: Substringing a variable length string

    Posted Fri October 01, 2004 10:53 AM

    I have figured ou a way of doing it. I first used the substring before method to get all chars before the % sign and then traslated any numbers to blanks.


    #Tamino
    #webMethods
    #API-Management


  • 4.  RE: Substringing a variable length string

    Posted Fri October 01, 2004 12:12 PM

    Hi,

    Try this:
    substring-before(“Stocks 12% of Posts”,“% of Posts”)
    yields
    “Stocks 12”

    Removing the trailing " 12" may be accomplished using substring() and string-length()
    provided you know e.g. that the number is always 2 digits wide.

    Regards
    Uli


    #Tamino
    #webMethods
    #API-Management