Z
Zhenning Guan
my_ip = (require 'open-uri' ; open("http://myip.dk") { |f|
/([0-9]{1,3}\.){3}[0-9]{1,3}/.match(f.read)[0].to_a[0] })
what is the different between match(f.read)[0].to_a[0] and match(f.read)
?
is someone can explain it?
/([0-9]{1,3}\.){3}[0-9]{1,3}/.match(f.read)[0].to_a[0] })
what is the different between match(f.read)[0].to_a[0] and match(f.read)
?
is someone can explain it?