I am looking for a way to convert my List(Of string) into an Object in vb. So in the end it would be the same as declaring Dim cArray() As Object = new Object. Can anyone point me to how i can achieve this? I cannot use the LINQ .ToArray as that creates a string array and this is not acceptable for my work. I need to pass this object into another one that has the parameter (aArray as Object).
Thanks
So you want to pass the entire array to a single Object
? That's an implicit conversion, you don't need to do anything. If it takes an array of Object
, you can use .Cast(Of Object)().ToArray()
. But consider changing the destination method if at all possible to avoid unnecessary casting back and forth between the two.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With