Sunday, June 20, 2010

Learn Ruby - String Manipulation

Converting to upper case
puts 'Hello, World'.upcase

Getting command line input
print 'Enter your name : '
name = gets
puts "Hello #{name}"

Calculation and Print
# This is a comment
#{This is a comment}
puts("\n\t#{(1+2)*3}")

No comments:

Post a Comment