루비(2)

언어/Ruby2016. 1. 18. 22:57
#<<< 형변환 >>>
a = 123
a_double = 123.to_f
printf("%d\n", a)
printf("%.2f\n", a_double)

#<<< 문자열 >>>
str = "Welcome to hell korea"
p "#{str}"
p '#{str}'
puts str.include?("to")
puts str.include?("kim")

'언어 > Ruby' 카테고리의 다른 글

루비(공부)  (0) 2016.01.20
루비구현(시저암호)  (0) 2016.01.19
루비(4)  (0) 2016.01.18
루비(3)  (0) 2016.01.18
루비(stu1)  (0) 2016.01.18