Split out ints from string

前端 未结 13 1344
情歌与酒
情歌与酒 2021-01-17 17:45

Let\'s say I have a web page that currently accepts a single ID value via a url parameter:
http://example.com/mypage.aspx?ID=1234

I want to change it to acce

13条回答
  •  时光说笑
    2021-01-17 18:04

    You can instantiate a List from an array.

    VB.NET:

    Dim lstIDs as new List(of Integer)(ids.split(','))
    

    This is prone to casting errors though if the array contains non-int elements

提交回复
热议问题