开发者

How to cast a List object of chars in an Array of chars?

开发者 https://www.devze.com 2023-01-25 21:11 出处:网络
How to convert or make a cast of a List object typized as a container of chars like Dim mylist As List(Of Char) = New 开发者_StackOverflow社区List(Of Char)(New Char() {\"1\"c, \"2\"c})

How to convert or make a cast of a List object typized as a container of chars like

Dim mylist As List(Of Char) = New 开发者_StackOverflow社区List(Of Char)(New Char() {"1"c, "2"c})

in a simple array of chars as

Dim mychars() As Char

without make a loop for...

thank you

Max


Have you tried the List(Of T).ToArray method?

For example:

Dim myChars() as Char = myList.ToArray()
0

精彩评论

暂无评论...
验证码 换一张
取 消