How to Extract List of String into String Value

My Goal Here is to get all the files from a folder. and wanted to check all the list of files that has been collected.

image
image

Hi,

Can you try the following?

yourString = String.Join(vbCrLf,strFileArr)

Regards,

Hi, can you help me also to store all the list of string file in One string variable?

Hi,

Do you mean to all items of multiple list of string to single string?
If so and they are List ( this means List<List<String>>, can you try the following expression?

yourString = String.Join(vbCrLf, listListString.Select(Function(x) String.Join(vbCrLf,x)))

Regards,

1 Like

Hi @Vincent_Nuestro

You can try this also,

In assign activity,

strText = String.Join(β€œ,”,strFilearr.toarray)

And one more question why are you looping the array store it in a list and then again convert it into string, you can skip the for each part right…

Thanks

1 Like

Hi Thanks @prasath_S @Yoichi ,

I Think I have another problem, Those List of Strings are Files in a folder and wanted to Get those files and attached in the email Using Invoke Code.

image

The problem is, after I Stored the list of String in One String using this strText = String.Join(β€œ,”,strFilearr.toarray) It gives me the full path of Each Files, the reason why it throws some error.

I just wanted all files in one Folder and attached it in the email

image

Thank you, Please help me

Hi @Vincent_Nuestro ,

I believe you just wanted to get the path of all files in a folder into an array of String String[] so that you can add to a mail object as attachment. You can do it as follows:

strFileArr = Directory.GetFiles(Config("AttachementsPath")) . Note that the variable strFileArr should be of type String[]

Hope that helps !

Thanks & Regards,
Nithin

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