Jump to content

How to get a segment from an Ip adress?


Recommended Posts

Try with: StringSplit ( "string", "delimiters" [, flag ] )

This returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings.

$array = StringSplit("ip",".")

$array[3] would be 3rd segment.

Link to comment
Share on other sites

Try with: StringSplit ( "string", "delimiters" [, flag ] )

This returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings.

$array = StringSplit("ip",".")

$array[3] would be 3rd segment.

It's done;) Thanks!!! :)

----------------------------------------------------------

$IP= "192.168.67.1"

$Segment= StringSplit($IP, ".")

MsgBox(0, "The 3rd segment is:", $segment[3])

----------------------------------------------------------

Edited by franzmicquelini
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...