How to append values to a variable of type array?

Hello everyone,
I got a problem to consult with you.
Two string variables: str1 , str2
An array variable:arr

I try to use activity “assign”,do you know how to append “str1”,“str2” to “arr”?

Thanks

1 Like

Hi,

There are some ways to achieve it. I’ll show one of them as the following.

arr : String[] type
list : List<string> type

Regards,

1 Like

I tried this way,but can’t create a List type.

Hi,

Can you select “String” as the following image?

Regards,

Hi,
you can assign to a cell, you can try this method:
str1=“Your Value”
str2=“Your Value”
String.Concat(str1,str2)

Regards,
Neelima.

Thank you ,it works well now.

And could you have a look at the picture below. Do you know ,does this way work well ? and how?

Thank you ,i 'll have a try.

Hi,

You can also use Append method. This returns IEnumerable<T> type, so it will be the following.

arr = {"1", "2"}
arr = arr.Append(str1).ToArray
arr = arr.Append(str2).ToArray

Regards,

1 Like

Thank you very much.

1 Like

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