I have a method which I need to call which accepts a ParamArray
Method(ByVal ParamArray elements() As Object)
I need to pass it two known strings, and an unknown number of strings, based on a variable number of XmlNodes in an XmlDocument
i.e.
Method("Known String 1", "Known String 2", Node1.OuterXml, ..., NodeN.OuterXml)
How can I do this?
I have tried looping through the nodes and creating and passing:
List(Of String)
which results in elements()
containing "Known String 1", "Known String 2", System.Collections.Generic.List[System.String]
List(Of String).ToArray
which results in elements()
containing "Known String 1", "Known String 2", System.String[]
String()
which results in elements()
containing "Known String 1", "Known String 2", System.String[]
and
Collection
which results in elements()
containing "Known String 1", "Known String 2", Microsoft.VisualBasic.Collection
What I want, for an example of 3 nodes is elements()
to contain "Known String 1", "Known String 2", "<node 1>", "<node 2>", "<node 3>"
Is this possible?