shrutika
(Shrutika Dambre)
July 31, 2018, 9:14am
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?
1 Like
Chinh_Le
(Chinh Le Duc)
July 31, 2018, 9:19am
2
Hi @shrutika ,
Use while…do instead foreach
Read more for each activity in here
Timber
(Vaidotas Kumža)
July 31, 2018, 9:32am
3
Hey @shrutika , I attached xaml which do what you want
Main.xaml (7.8 KB)
shrutika
(Shrutika Dambre)
July 31, 2018, 10:10am
4
I am still getting the same error
Timber
(Vaidotas Kumža)
July 31, 2018, 10:14am
5
Check if list1 doesn’t have more items than list2
Uemoe
(Konstantin Marushchak)
July 31, 2018, 11:00am
6
You can use LINQ.
Assign NewList = list1.Zip(list2, Function(a, b) a+b).ToArray
1 Like