Unable to split a array of string

Hi,

I have a string (Invoice numbers) which I am getting from datarow. I need to split this string into individual items. The string looks like below format.

1573661473, 1064127539
1063135842, 1063135865
1063135926, 1064118204
1573657280, 1573657281
1064127539, 1573661473
1063136036, 1063136037
1573096301
1063137220, 1063137221
1573097055

I need the Data to be split with each Invoice number (for example ‘1573661473’). so that I can iterate through each Invoice number. can you please check.

Hi @ashok.p

I hope this might be helpful to you .Please see the link below for your reference.

cheers :smiley:

Happy learning :smiley:

@ashok.p

all these invoice numbers in a single string? or these are datarow values?

Simple.
StrArrayVar= trim(yourstring). replace (“,”," “). split (” "c)
It will split by space and will store all the values in StrArrayVar .

@ashok.p,

Use Splits method with comma (,) & Newline.
Assign
ArrStr (Array Of String) = a.Split({",",Environment.NewLine},StringSplitOptions.None)

This comes in a single string.

@ashok.p

You can split it based on comma then.

     arrInvoices [] = yourStr.Split(","c)

@samir,

This is giving the result in a sets of 2 to 3 Invoice numbers. please see the output format below.
image

@pattyricarte, thank you. checking on these.

You welcome @ashok.p

cheers :smiley:

Happy learning :smiley:

Okay, this will work for you @ashok.p,

ArrStr = Text.Split({vbLf,","},StringSplitOptions.RemoveEmptyEntries) 

Hi @ashok.p ,

Regex_ToArray.xaml (7.2 KB)

Thanks!