Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trying to an equation in String form ("1+2-3/4 etc")

807600Nov 9 2007 — edited Nov 13 2007
Hi, I'm trying to take an equation in String form and get an Integer answer from it. I've been reading about String Tokenizer and Split, but I can't seem to make the jump from String "1+2-3" to int 0. Any help is very much appreciated, I've been trying to figure this out for hours. I've tried a few things including splitting it into arrays of numbers and operators, casting the string as an int, etc. I'm at a loss. Thanks for reading.

IDE NetBeans 6.0
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2007
Added on Nov 9 2007
10 comments
254 views