A

Admin • 828.03K Points
Coach

Q. Which method is used to convert a string to integer in Ruby?

  • (A) to_int
  • (B) to_i
  • (C) int()
  • (D) convert_to_int
  • Correct Answer - Option(B)
  • Views: 8
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
The 'to_i' method converts a string to an integer in Ruby.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.