Loading...
Logo
Processing Forum
I am now working on making a library, and am doing fairly well because of some help that I got from a previous question. However, I'm trying to convert a string into an integer, and it isn't letting me do int(string),or (int) (string), or parent.int(string). I didn't really expect the first two to work, but still I'm stuck. Help, please? 

Replies(2)

With the above, you need to catch the possible exception.
Alternatively, just use the mechanism behind int(s) (which isn't legal Java!): PApplet.parseInt() which works with most common Processing types, including arrays! You have also PApplet.parseFloat().