If i want to compare to numbers in strings containing numbers, such as the 1 in the string 12345 and the 2 in string 21345 how could this be done? My friend told me I could parseint them but I'm not familiar with parsing,thanks!
Printable View
If i want to compare to numbers in strings containing numbers, such as the 1 in the string 12345 and the 2 in string 21345 how could this be done? My friend told me I could parseint them but I'm not familiar with parsing,thanks!
Converting Between Numbers and Strings (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
Oracle's Tutorial page at that link talks about floating point numbers rather than integers, but the idea is the same. The parseInt() method they talk about is fully described in its API docs.