File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes convert string into int Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "convert string into int" Watch "convert string into int" New topic
Author

convert string into int

Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
hi there!!!
i have one problem....
i have a string 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
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Convert the String to an int and do the comparision


Mani
Quaerendo Invenietis
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: convert string into int
 
Similar Threads
need help?
Hibernate: native query to wrap the collection
comparing and sorting arraylist of arraylist
column heading dates ...
enum + select on Struts 2