How to initialize ICollection of Array of string?

I have a collection in Add To Collection activity. The collection needs to store Arrays of strings.

How to initialize the collection variable ? Without that its throwing error.

Variable Type: ICollection<String>.

@ppr
The above link has same question. But there is no answer.

Hi,

@ppr shows it’s new List(Of String()) in the above topic, as the following.

Regards,

Thanks @Yoichi @ppr. Its working.

But Its just list of string. But our variable is collection of string arrays. So how is it working ?

Hi,

Nope, it’s list of string array.

List of String : new List(Of String)
List of String Array : new List(Of String())

Regards,

Ok.

I was trying new List(Of String(){}).

@Yoichi @ppr

Can anyone please guide me how to store data in the Collection of Arrays of Strings ? So basically i have some string values getting dynamically and need to store in the string array inside the collection.

How to achieve this ?

If i am doing Coll_Variable(0)(0) then there are no method through which I can insert the string variable.

Hi,

Can you try to use AddToCollection activity or ICollection<T>.Add method with Invoke Method activity?

Regards,

Actually what i need to do is let say i have five stings. Then for each of those five strings one by one i need to insert the strings to the subsequent array in the collection.

So whenever i get a new string i need to traverse to that array, then in that array i need to insert that particular string.

invoke method

Getting this message. What does this mean ? I have provided all the necessary details.

Hi,

In this case, I think List<List<String>> is better.

Hope the following sample helps you.

Main.xaml (8.6 KB)

Regards,

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