字符插入必须使用双引号

#correct code, use double quotes
p "enter the name"
name = gets.chomp
p "the animal name is #{name}" #"the animal name is xx"

#wrong code, use single quotes
p "enter the name"
name = gets.chomp
p 'the animal name is #{name}' #"the animal name is \#{name}"

results matching ""

    No results matching ""