Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make the dot dissapear in IP address

Status
Not open for further replies.

bataraguru

Programmer
Joined
Jun 4, 2002
Messages
37
Location
MY
Hi again,
I have a problem to make the dot in IP address dissapear.
Example:
172.32.10.111
I want to make this IP addr to be just
1723210111 <-- with no &quot;dot&quot;

Can anybody help me?
I know this is just number manipulation, but I cant find it anywhere..
please help...

Thanks,
- zack -
 
Hi,

seperate out each and every character from the string. Except dot insert each and every character into one array.

Function to be used: LEFT(), ArraryInsertAT()
 
Hi,

<cfset Ip1 = trim(ListGetAt(IpAddress_withdot,1,&quot;.&quot;))>
<cfset Ip2 = trim(ListGetAt(IpAddress_withdot,2,&quot;.&quot;))>
similary get Ip3 and Ip4.

insert each number from Ip1, Ip2, IP3 and Ip4 to one common array.
<cfset counter = 1>
<cfloop from i = &quot;1&quot; to i=&quot;#len(ip1)#>
<arrayinsertat[counter]=left(ip1,1)>
<counter = counter +1>
</cfloop>
 
How about a simple replace?

<cfset myIp = &quot;172.32.10.111&quot;>

<cfset myIp = Replace(myIP,&quot;.&quot;,&quot;&quot;,&quot;all&quot;)>



 
thanks guys,
your answer really help me...
thanks again...

- zack -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top