File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
convert string into int
Joined: Oct 28, 2004
Apr 06, 2005 01:45:00
i have one problem....
i have a
which actually an integer...because it was selected from a string...
eg : i buy 2 cakes
the selected substring is 2(name as select)
i need to compare it...if select is less then 0....then it will instantiate to 0....where it will the gives the output as
i buy 0 cake...
the problem is....i cant do the comparison because 2 is not an integer...its a string.....
can anybody help me solve this problem
Joined: Mar 11, 2002
Apr 06, 2005 02:05:00
Convert the String to an int and do the comparision
Integer.parseInt(String s) //will return an int
I agree. Here's the link:
subject: convert string into int
Hibernate: native query to wrap the collection
comparing and sorting arraylist of arraylist
column heading dates ...
enum + select on Struts 2
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013