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
Expand all | Collapse all

Looping a StringList and count

  • 1.  Looping a StringList and count

    Posted Fri August 03, 2007 11:48 PM

    How do I loop a stringlist and count the number of occurances of a letter in each string list item.
    If the following is a string list:
    0 aaaaaaaaaa
    1 bbbbbbaabb
    2 ccccaccccc

    how do I get the count of a’s
    like listitem[0]=10
    listitem[1]=2
    listitem[2]=1

    thanks


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


  • 2.  RE: Looping a StringList and count

    Posted Sun August 05, 2007 06:52 PM

    Try a Java service for looping each string list and check for the character and increment the count if it is found for the list.


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


  • 3.  RE: Looping a StringList and count

    Posted Mon August 06, 2007 05:27 PM

    Use a FLOW loop step to iterate over the list. Create a Java service to count the number of times a particular character appears. Call that service from within the loop. You can put the results of each count in the output list of the loop.


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


  • 4.  RE: Looping a StringList and count

    Posted Mon August 06, 2007 10:34 PM