#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    1
    Rep Power
    0

    Splitting the IP address string


    Hi,



    I have an IP address in a variable. I want to split the IP address in such a way that I will get the last part of IP address in another variable. please help.





    <CFPARAM name="IPaddr" default="10.22.134.56">



    My Variable IPaddr changes dynamically in code



    I want to get last part 56(any dynamic value) in another variable. any ideas?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    Treat the string as a dot-delimited list, and get the fourth element.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    10
    Code:
    ListGetAt("10.22.134.56", 4, ".")

IMN logo majestic logo threadwatch logo seochat tools logo