LinQ to Add Array in Another Array

I know how to do it with the activities but i Want to do it in a linq
I need to put and Array into Another Arry
So i do a for each in the first Array and then separate by commas and add that arry result to the arrays of arrays.

I have this array {“1,2,3,4”,“5,6,7,8”}
and the output that i want is
{{“1”,“2”,“3”,“4”},{“5”,“6”,“7”,“8”}}

Also any sugestion where i can learn linq ?

1 Like

Hi @Fabio_Villamil

Try the below linQ expression,

- Assign -> inputArray = {"1,2,3,4","5,6,7,8"}

- Assign -> outputArray = inputArray.Select(Function(str) str.Split({","c}).ToArray()).ToArray()

Check the below workflow for better understanding,

Hope it helps!!

2 Likes

Hey @Fabio_Villamil
try this:
outputArray = inputArray.Select(Function(s) s.Split(","c)).ToArray()

1 Like

You can start here:
[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

For experiments, we recommend doing the prototyping within the immediate panel:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

2 Likes

Hi,

Input:-
image

Output:-
image

Xaml file:-
Main.xaml (8.1 KB)

If this works for you, please mark this as a solution, so others can refer the same… :slight_smile:
Thanks

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