Examveda

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


This Question Belongs to Ruby Programming >> Basic Syntax In Ruby

Join The Discussion

Related Questions on Basic Syntax in Ruby