Get part of a string based on index

Hi All,

I am having below string,
"Revenue Account Sequence : 96467, INCAS Amount Code : AGS"
I want to retrieve 96467 and AGS based on below logic.

  1. Logic for retrieving 96467 -> Text between "Sequence : " and “,” .
  2. Logic for retrieving AGS -> Text between "Code : " and " ".

I am having hard time finding a solution for it. It would be great if someone can help me with it.

Use Split function…split with colon : and use string manipulation… u will get it…

1 Like

If you opt for string manipulations here is what you can do.
say your string variable is str

  1. Do a split by ‘:’ so you get an array of strings say var-array and remove empty spaces option enabled.
    so our array of string type looks like this:
    a[0]= Revenue Account Sequence
    a[1]= 96467, INCAS Amount Code
    a[2]= AGS

so value1=a[1].Substring(0,a[1].IndexOf(","))
and value2= a[2]

Try to apply this logic and it should work out.


You can use regex to extract the data.
To extract number : (?<=Sequence :).(?=, INCAS)
use the above with in double quotes in matches activity and pass the string as input.
To Extract Account Code: (?<=Amount Code :).

Let us know if this helps,
Pavan H


Hi @Kapil

I have created a sample workflow to get the values you need. Please check the attached…

SplitTest.xaml (5.4 KB)

1 Like

Thanks Fernando! It’s working…learned something new today :slightly_smiling_face:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.