This site requires JavaScript, please enable it in your browser!
Greenfoot back
egc2505
egc2505 wrote ...

2020/2/18

Is there a way to convert String input to Integer

egc2505 egc2505

2020/2/18

#
Hi, I am using InputDialog box to receive input values and use those values in math solutions. but I am receiving an error that String cannot be converted to Int. Help. Thanks.
Super_Hippo Super_Hippo

2020/2/19

#
You can use the “Integer.valueOf()” method. It takes a String as a parameter and converts it to an int (or gives you an error when the string isn’t a number).
You need to login to post a reply.