This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Picking characters from a string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Picking characters from a string

Doug Wolfinger
Greenhorn

Joined: Jul 27, 2002
Posts: 18
Hello,
I am trying to pass a string that represents a postfix expression. The method that accepts it should take each number and place it on the stack. When it encounters an operator, it should pop the top two numbers and evaluate them with the operator.
This is the expression. "abc+-"
a=7, b=3, c=12 So it applies "+" to c and b, then it subtracts (c + b) from a. I have made the string into a string array in my program, but I think the idea is to pass the expression as a regular string as I have it above. Thanks!

If you would like to use that program, you'll need this one, too.
Doug Wolfinger
Greenhorn

Joined: Jul 27, 2002
Posts: 18
My bad. I've copied this to the Intermediate forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Picking characters from a string
 
Similar Threads
Selecting characters from a string
Input error in math equation
A continuation of my previous post, if I may...
Trouble evaluating postfix Expression
Converting Infix to Postfix Expressions