When outputting ", backslash
Option + ¥ mark on mac
8 Working With String
puts "Giraffe" Academy"
# Giraffe" Academy
phrase = "Giraffe Academy"
puts phrase
#Giraffe Academy
puts.upcase()
#GIRAFFE ACADEMY
puts.downcase()
#giraffe academy
phrase = " Giraffe Academy "
puts phrase.strip()
#Giraffe Academy
puts.phrase.length() #15 puts phrase.include? "Academy" #true puts phrase.include? "Academys" #false puts phrase[0] #G puts phrase[3] #a puts phrase[0,3] #Gir puts phrase.index(G) #0 puts phrase.index(ffe) #4 puts "programming".upcase() #PROGRAMMING
Recommended Posts