Ruby program to convert the string into an integer

bookmark

str = "10.5";
result = str.to_i();  

print "Result: ",result;

 


Output:

Result: 10