From: Joel VanderWerf Date: 2008-02-20T10:54:27+09:00 Subject: Re: IP Address to Decimal - is an one-liner possible? Tiago Pinto wrote: > Hi guys, > > A friend of mine needs to convert a string containing an IP Address > (such as "127.0.0.1") to a decimal (that example would translate to > 2130706433, said). "127.0.0.1".split(".").map{|s|s.to_i}.pack("C*").unpack("N") -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407