Spilt IP:Port to 2 strings.

  • Thread starter Thread starter Donald Smith
  • Start date Start date
D

Donald Smith

Hey,

How can I spilt a string like this: 216.240.148.110:27970 into 2 strings at
the ':' sign? (An IP, and a Port)
Ex: After the splitting occurs, string1 = 216.240.148.110, and String2 =
27970.

thanks
 
Use String.Split()

Dim res As String()
Dim val As String = "216.240.148.110:27970"
res = val.Split (":")
' res(0) - IP; res(1) - Port#

Hey,

How can I spilt a string like this: 216.240.148.110:27970 into 2 strings at
the ':' sign? (An IP, and a Port)
Ex: After the splitting occurs, string1 = 216.240.148.110, and String2 =
27970.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top