Syntax result in string for List array of string with Invoke Method Add

Variable
Array1 = {“A”,“B”,“C”} type is String
Array2 = {"D,“E”,“F”} type is String
List1 = new list(of string()) from {Array1,Array2}

Design Activity using Invoke Method
TargetType = null
TargetObject = List1
MethodName = Add
it’s parameters is
Direction = in
Type = String
Value = {“apple”,“banana”}

i need help to write the result in string showing in two ways

ABCDEFapplebanana
A,B,C,D,E,F,apple,banana

Thank You.

Hi,

How about the following?

String.Join("",List1.SelectMany(Function(a) a))

String.Join(",",List1.SelectMany(Function(a) a))

Sample20230421-3L.zip (2.4 KB)

Regards,

Got it.
Thank you

Hi Yochi,

Can New List consist of any variable type?
what should be the syntax if i still want the end result to be
123XYz
1,2,3,X,y.z

Many Thanks

No, Int32() etc cannot be item of the array. It’s necessary to convert to object array as the following, for example.

New List(Of Object())From {intArr.Select(Function(i) cobj(i)).ToArray,strArr}

Regards,

Thanks Yoichi.
May i know what is the (i) meaning…Select(Function(i) CObj(i)).ToArray
And if it’s variable type is List<Int32>
should i write
New List(of Integer())From {strArr.Select(Function(s) CInt(is).ToArray,intArr}

and my write line will be (my LIst variable name is List_Int)
String.Join(" ",List_Int.SelectMany(Function(a) a))
what is the (a) means?

Thank You.

Hi Peter,

Thanks for sharing.
However i am not C# nor coding savvy person.

Could you kindly explain it in plain layman term
What is the meaning for (i) in this syntax?
New List(Of Object())From {intArr.Select(Function(i) cobj(i)).ToArray,strArr}
Is it integer? so should i need to change it to (s) if i want it to be a string?
New List(Of Object())From {intArr.Select(Function(s) cobj(s)).ToArray,strArr}

And What is the meaning for (a) in this syntax?
String.Join(" ",List_Int.SelectMany(Function(a) a))

Thank You.

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