Split a String and match the arrays

code

#1

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


Extracting letters from a word/string
#2

Hi,

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

br,
Topi


#3

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


#4

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