learn_ruby_ch4_pt1 Flashcards
1
Q
Get information on the String instance method chop
A
ri String#chop [or] ri String.chop
2
Q
Create a new empty string called title
Validate it is empty
Check its size
A
title = String.new # => “”
title. empty? # => true
title. length [or] title.size # => 0
3
Q
Show three ways to create a new string of “Much Ado about Nothing”
A
title = String.new( “Much Ado about Nothing” )
title = String( “Much Ado about Nothing” )
title = “Much Ado about Nothing”
4
Q
Delimit strings with !, [ ], and ( )
A
comedy = %!As You Like It! history = %[Henry V] tragedy = %(Julius Ceasar)
5
Q
Indented “here” document
A
ind = <<-hello # for indentation Hello, Matz! hello