How to split string into array at the end of every line

I would like to change the strings into an array, so that when I run it through a for loop it would be like this

Output:
235521254_WB_MME,2321099136_INV, 2321099136_PL

235521254_WB_MME,2321099390_INV, 2321099390_PL

101066898_WB_WME,WME20230410940490_iv_WME,WME20230410940490

This is the current output of it, which if I were to run it through a for loop it will print the out character by character
image

@SRoyi

Welcome to the community

Please use this
Arrayvar = str.Split({Environment.NewLine},Stringsplitoptions.RemoveEmptyEntries)

Str is the string variable where the data is stored

Cheers

1 Like

It works for me.

1 Like

Hello,

Thanks for the help and warm welcome!

1 Like

Hi there just a follow up question that I have. Lets say I want to search for a file with the output values, would they have to be in string format?

@SRoyi

Can you please elaborate? when you say they have to be in string format? which one are you referring to?

cheers

Let me elaborate. So right now for example I want to search with Path Exist for these 3 files.
235521254_WB_MME, 2321099136_INV, 2321099136_PL (currently in array format)

would they need to be in string if I want to search individually out of the 3? So the system would search with 235521254_WB_MME first and so on.

thanks

@SRoyi

Yes they should be in string format…like say array is vararray then vararray(0) will give you the first string

Hope this helps

cheers

1 Like

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