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
 
Back
Top