J
Jon Kim
Hi,
I am newbie in Ruby. I have a question about indenting string.
there is strings like below:
www.google.com => 123.123.123.12
www.ibm.com => 123.112.123.12
www.iowahawkeyes => 123.123.112.12
i want to make above like next
www.google.com => 123.123.123.12
www.ibm.com => 123.112.123.12
www.iowahawkeyes => 123.123.112.12
original code was
puts (dns + " => " + ip)
I tried next code
puts (dns + " "*(20 - dns.length) + " = > " + ip)
but it did not work well. please teach me how to do it.
I am newbie in Ruby. I have a question about indenting string.
there is strings like below:
www.google.com => 123.123.123.12
www.ibm.com => 123.112.123.12
www.iowahawkeyes => 123.123.112.12
i want to make above like next
www.google.com => 123.123.123.12
www.ibm.com => 123.112.123.12
www.iowahawkeyes => 123.123.112.12
original code was
puts (dns + " => " + ip)
I tried next code
puts (dns + " "*(20 - dns.length) + " = > " + ip)
but it did not work well. please teach me how to do it.