Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/10/2011, 16:47
bigwhite
 
Fecha de Ingreso: agosto-2009
Mensajes: 247
Antigüedad: 15 años, 3 meses
Puntos: 10
Respuesta: Que es el metodo 'p' ??

# print is 'low level', puts
# puts adds a \n if needed
# p dumps a variable - so quotes it

print "Hello Melksham\n"
puts "Hello Trowbridge"
puts "Hello Chippenham\n"
p "Hello Wiltshire\n"

town = "Salisbury"

# Use of #{....} for a variable name in double quotes

print "Shall we go to #{town} tomorrow?\n"

__END__

Sample output:

wizard:rr graham$ ruby print.rb
Hello Melksham
Hello Trowbridge
Hello Chippenham
"Hello Wiltshire\n"
Shall we go to Salisbury tomorrow?
wizard:rr graham$
__________________
The best powerful search engine for MSN messenger profiles I know is msn profile viewer. It's really good either if you have an e-mail address or not. Try it!