need help on thisβ¦
Array1 = {1, 2, 3, 0, 5, 6, 0, 0, 0, 9, 7}
Array2 = {8, 0, 0, 4}
Your Output array must be:
{1, 2, 3, 4, 5, 6, 7, 8, 9}
need help on thisβ¦
Array1 = {1, 2, 3, 0, 5, 6, 0, 0, 0, 9, 7}
Array2 = {8, 0, 0, 4}
Your Output array must be:
{1, 2, 3, 4, 5, 6, 7, 8, 9}
You can join the two arrays as a string, simply by β+β operator
To convert array to string:
String.Join(β,β,array1)
Then after you have ont string with all the values from both array. You can replace β,0β with ββ
newStringCreated.Replace(β, 0β,ββ)
if you need the string to be converted back to array, you can use
newStringCreated.Split(β,β)
similar logic you can do via datatable but this is more cleaner approach.
Hope this helps!
Hi
Letβs go with a single expression in a assign activity like this
arr_final = Array.Sort(Array1.Where(Function(a) NOT a.ToString.Contains(β0β)).ToArray().Concat(Array2.where(Function(b) NOT b.ToString.Contains(β0β))))
In separate
Array1.Where(Function(a) NOT a.ToString.Contains(β0β)).ToArray()
This will delete 0 in a array1
Array2.where(Function(b) NOT b.ToString.Contains(β0β)))
This will delete 0 in array2
Concat() - will add these two arrays
Array.Sort() - this will sort the array
Hope this would help you resolve this issue
To get that as a string and show in message box
String.Join(β-β,arr_final)
Cheers @Sudheer_Kumar1
Hi,
Another solution:
result = array1.Union(array2).Where(Function(i) i>0).OrderBy(Function(i) i).ToArray()
Regards,
@Yoichi thanks for your reply i am unable to show array result in message box it is showing as System.Int32
Hi
Can you try the following?
String.Join(",", intArray)
Regards,
I have updated in the previous comment which has the complete step to solve this
@Sudheer_Kumar1
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.