What is the correct way to cast a string to an integer in Ruby?
A. string.to_i
B. string.integer
C. int(string)
D. string.convert(:integer)
Answer: Option A
A. string.to_i
B. string.integer
C. int(string)
D. string.convert(:integer)
Answer: Option A
What does the 'puts' method do in Ruby?
A. Prints to console
B. Converts to string
C. Finds the length
D. Reads input from user
Join The Discussion