How to join data into a list of string

Hi all,

I would like to join these all into a string, so that when I it through a loop, it will loop through the entire filename instead of letter by letter.
image
(Each row represents 1 row and 3 columns of data from an excel file)

Thanks

Hi @SRoyi

Can you please specify the expected output for the same?

Best Regards.

Hi,

The expected result would be:
23255212544_WB_MME,2321099136_INV,2321099136_PL,23255212544_WB_MME,2321099390_INV,2321099390_PL,101066898_WB_WME,WME20230410940490_iv_WME,WME20230410940490_PL_WME

Cheers

@SRoyi

Well, in that case, please use the following expression to get the desired result:

String.Join(",", System.Text.RegularExpressions.Regex.Split(strData, "\r?\n"))

Input data & transformed data is shown below:

image

Hope this helps,
Best Regards.

Hey thanks it worked.

I would like to ask a separate question, that is why is it if I were to run it through a for loop, it runs through character by character instead of the whole name?

Cheers

@SRoyi

Not sure if the loop was on the ToCharArray(), but no issues. Now it will take up the entire word when you iterate through the array.

Best Regards.

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