How to merge two string lists

I have two string lists as follows:
List1={‘abc’,‘123’} and List2={‘pqr’,‘456’}
I want to merge these two lists into one such that the output will be:
I have done it like this:


I am getting following error:
Index was out of range
What am I doing wrong?

1 Like

Hi @shrutika,

Use while…do instead foreach

Read more for each activity in here

Hey @shrutika, I attached xaml which do what you want

Main.xaml (7.8 KB)

I am still getting the same error

Check if list1 doesn’t have more items than list2

You can use LINQ.
Assign NewList = list1.Zip(list2, Function(a, b) a+b).ToArray

1 Like