# LinQ to Add Array in Another Array

**URL:** <https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634>\
**Category:** Something Else\
**Tags:** feedback, studio\
**Created:** [March 14, 2024, 7:07am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634 "2024-03-14T07:07:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabio\_Villamil](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/fabio_villamil/32/384288_2.png) [@Fabio\_Villamil](https://forum.uipath.com/u/Fabio_Villamil)\
**Post date:** [March 14, 2024, 7:07am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634/1 "2024-03-14T07:07:53Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![mkankatala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mkankatala/32/484097_2.png) [@mkankatala](https://forum.uipath.com/u/mkankatala)\
**Post date:** [March 14, 2024, 7:12am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634/2 "2024-03-14T07:12:51Z")

</div>

Hi @Fabio_Villamil

Try the below linQ expression,

```auto
- 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,

 ![image](https://global.discourse-cdn.com/uipath/original/4X/6/e/a/6ea9e7bb2a82b2d7d775779e8fea3149f3be264d.png)

Hope it helps!!

---

<div class="post-metadata">

**Author:** ![pikorpa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pikorpa/32/548059_2.png) [@pikorpa](https://forum.uipath.com/u/pikorpa)\
**Post date:** [March 14, 2024, 7:23am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634/3 "2024-03-14T07:23:31Z")

</div>

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

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/b/4/fb4e3a2e83e050697cd7e66dfb92e23d8cf0ec87.png)

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [March 14, 2024, 8:59am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634/4 "2024-03-14T08:59:39Z")

</div>

> [@Fabio\_Villamil](#):
>
> any sugestion where i can learn linq

You can start here:  
[[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum](https://forum.uipath.com/t/howto-linq-vb-net-learning-catalogue/325671)

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](https://forum.uipath.com/t/understanding-the-6-debugging-panels-of-uipath-in-the-easiest-way-possible/353606)

---

<div class="post-metadata">

**Author:** ![Jayesh\_678](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jayesh_678/32/219158_2.png) [@Jayesh\_678](https://forum.uipath.com/u/Jayesh_678)\
**Post date:** [March 14, 2024, 9:36am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634/5 "2024-03-14T09:36:11Z")

</div>

Hi,

Input:-  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/2/a/6/2a6ff49d129dc72bd125ce2cdf354f774ea30c19.png)

Output:-  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/2/c/1/2c10398ccd9eba4b754ece43265e0f431aa5f270.png)

Xaml file:-  
[Main.xaml](https://forum.uipath.com/uploads/short-url/9PKykd0J8PTA4ZBd1v3CppK64wB.xaml) (8.1 KB)

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

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [March 17, 2024, 9:36am UTC](https://forum.uipath.com/t/linq-to-add-array-in-another-array/726634/6 "2024-03-17T09:36:47Z")

</div>

Closed on March 17, 2024, 9:36am UTC

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