Foreach loop output as array instead of string.join


Hi all,

I have these items that I get from the for each loop. I am hoping to assign these items into an array instead of string which I use string.join. could you please provide the syntax? Thanks in advance!
@ovi, if you may know?

Warm regards,


Hello @lavint,

Please refer to this link, if this is what you require! :slight_smile:


Hi @Rishabh_Lakhera,

Thanks for your response! I’d like it to be String[ ] not String.

For each item in items
I do something
then Assign String[] itemString = … .ToArray()

Do you know the Syntax? Thanks!

Warm regards,


May i know what you’re looping through with for each? is it a list? or another array?



For each item in Directory.getfile blah
For each str in string[] strA
if item.Contains(str)
Assign string[] thisIsWhatINeed = … . ToArray()


I am just wondering if there is a more efficient way in stead of join then split for the array.




Could you please check if this helps you?
This is how i assigned the list items to the array.
Main (1).xaml (18.6 KB)


Definitely! thanks @Rishabh_Lakhera
I think join then split maybe a more simple fit for my situation. Thank you very much though :slight_smile: