我想做这样的事情:
Dim Foo as String = "a,b,c,d,e" Dim Boo as List(of String) = Foo.Split(","c)
当然Foo.Split
返回一维数组String
,而不是通用数组List
.有没有办法在不迭代数组的情况下将其转换为泛型List
?
如果您不想使用LINQ,您可以:
Dim foo As String = "a,b,c,d,e" Dim boo As New List(Of String)(foo.Split(","c))
您可以使用List的构造函数.
String foo = "a,b,c,d,e"; Listboo = new List (foo.Split(","));
你真的需要List