2 Replies Latest reply on Mar 4, 2014 10:20 PM by Francisco Amores

    FDMEE fParseString

    ClintH

      Can anyone tell the the FDMEE (Jython) equivalent to the function below?

       

      dr_str = DW.Utilities.fParseString(strrecord, 30, 12, cdelimiter)

        • 1. Re: FDMEE fParseString
          JeffJon

           

          fdmAPI.API.DataWindow.Utilities.API Call

           

           

          fParseString Method Extract a substring from a delimited string based on its field position within the total number of

           

          fields.

           

          Inputs: Inputs: ByVal strRecord As String, ByVal intFldCount As Integer, ByVal intFldToReturn As

           

          Integer, ByVal strDelimiter As String

           

          Output: String    

           

           

          • 2. Re: FDMEE fParseString
            Francisco Amores

            Hi,

             

            you can use split function:

             

            strDelim = ";"

            strSample = "a;b;c"

            firstPos = strSample.split(strDelim)[0]

            secPos = strSample.split(strDelim)[1]

            thirdPos = strSample.split(strDelim)[2]

             

            >>> strDelim = ";"

            >>> strSample = "a;b;c"

            >>> firstPos = strSample.split(strDelim)[0]

            >>> secPos = strSample.split(strDelim)[1]

            >>> thirdPos = strSample.split(strDelim)[2]

            >>> print firstPos

            a

            >>> print secPos

            b

            >>> print thirdPos

            c

             

            Regards

             

            akafdmee.blogspot.com