[CSC 204] Converting Strings to Integers

Andrew J. Pounds pounds_aj at mercer.edu
Wed Nov 2 17:09:36 EDT 2016


Another question that I have been asked about a lot is how to convert a 
string to an integer.


If I wanted to convert the first element of the roll string to an 
integer I would do the following.

|int number = Integer.parseInt(roll.substring(1,2)|


-- 
Andrew J. Pounds, Ph.D.  (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
http://faculty.mercer.edu/pounds_aj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc204/attachments/20161102/23778782/attachment.html>


More information about the csc204 mailing list