Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I am creating an Array like this:

Dim UserPass As String() = s.Split(New Char() {":"})

And I know there is atleast 2 values in the array:

Dim username As String = UserPass(0)
Dim password As String = UserPass(1)

But sometimes there will be 3 or 4 values..


Dim username As String = UserPass(0)
Dim password As String = UserPass(1)
Dim somethingelse As String = UserPass(2)
Dim somethingelse3 As String = UserPass(3)

 

I will not know if it will be 2,3, or 4 values..

 

How can I do the above (do I haveto use a try,catch?)

 

 

thanks

Lee

Edited by PlausiblyDamp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...