Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts 'Hello, world!'
- puts ''
- puts 'Good-bye.'
- # no space adding strings
- puts 'I like' + 'apple pie.'
- # spaces matter inside of strings
- puts 'I like ' + 'apple pie.'
- puts 'I like' + ' apple pie.'
- # multiply strings
- puts 'blink ' * 4
- # numbers vs. digits
- puts 12 + 12
- puts '12' + '12'
- puts '12 + 12'
- puts 2 * 5
- puts '2' * 5
- puts '2 * 5'
- # problems with strings - #<TypeError: can't convert Fixnum into String>
- # puts '12' + 12
- # puts 'Fred' * 'John'
- # puts 'Will' + 12
- # let the computer know I want to stay in the string with backslash (escape character for apostrophe and backslash itself)
- puts 'You\'re swell!'
- puts 'backslash at the end of a string: \\'
- puts 'up\\down'
- puts 'up\down'
Add Comment
Please, Sign In to add comment