How to merge two string lists

studio

#1

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:
List={‘abcpqr’,‘123456’}
I have done it like this:

item.ToString+List2(count)

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


#2

Hi @shrutika,

Use while…do instead foreach

Read more for each activity in here


#3

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

Main.xaml (7.8 KB)


#4

I am still getting the same error


#5

Check if list1 doesn’t have more items than list2


#6

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