Split a String and match the arrays

Hi guys,

I’m trying to split below string and store the arrays as: II (variable name: code1), 26 (variable name: amount1), YY (variable name: code2), 338 (variable name: amount2), YK (variable name: code3), 24 (variable name: amount3).

“II,YY, YK | 26, 338, 24 | INSURANCE,NIESTAND.WAGA,”

Also need to take note, sometimes the YY and YK will not mention. If doesn’t mention means need to put the string as empty.

Can anyone please help me on this coding. I’ve tried hard but still couldn’t figure out

Hi,

here’s a sample: Main.xaml (9.6 KB)

br,
Topi

1 Like

Hi @Serran_Neru,

strVariable=“II,YY, YK | 26, 338, 24 | INSURANCE,NIESTAND.WAGA,”
create ArrayVariable,ArrayVariable1
ArrayVariable=strVariable.ToString().Split("|"c)
ArrayVariable1=ArrayVariable(0).ToString().Split(","c)
ArrayVariable1(0)--->||
ArrayVariable1(1)--->YY
ArrayVariable1(2)--->YK

Regards,
Arivu

1 Like

Minor bug at the last assign, should be: amount3 = strArr(4).Trim.Split(" "c).First

Char%20array

Hi guys, I have use this code to put semicolon in a line (array of characters). can we use come way to put semicolons using single assign activity.
Please help

Hi @poojakumari,

Can you give your input and expected output, so that we can provide the exact answer

Regards,
Arivu