Convert string array to int array

后端 未结 6 1489
名媛妹妹
名媛妹妹 2021-02-04 03:42

I have tried a couple different ways and cannot seem to get the result I want using vb.net.

I have an array of strings. {\"55555 \",\"44444\", \" \"}

I need an

6条回答
  •  你的背包
    2021-02-04 03:59

    Maybe something like this:

    dim ls as new List(of string)()
    ls.Add("55555")
    ls.Add("44444")
    ls.Add(" ")
    Dim temp as integer
    Dim ls2 as List(Of integer)=ls.Where(function(x) integer.TryParse(x,temp)).Select(function(x) temp).ToList()
    

提交回复
热议问题