Results 1 to 4 of 4
- 10-30-2012, 01:28 AM #1
Member
- Join Date
- Aug 2012
- Posts
- 11
- Rep Power
- 0
Convert string operation symbols "+", "-", "/", "*" etc.
What is the easiest way to convert a string expression to something I can solve? I have never used association lists but could that work? Or maybe the replaceAll() function?
For clarification I'm trying to solve functions such as "3 + 4", or [ "3", "+", "4"].
- 10-30-2012, 08:16 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Re: Convert string operation symbols "+", "-", "/", "*" etc.
I once wrote a blog article for this forum: the article develops a compiler for infix expressions and shows you a way how to parse and interpret/evaluate those expressions. The blog article contains all the code. If I'm not mistaken there's a link to my blobs on the right side of this reply.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-30-2012, 09:40 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
- 10-30-2012, 03:06 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Handy conditional If code to handle "day" and "days". Needs a slight tweak.
By hamster in forum AlgorithmReplies: 2Last Post: 04-29-2012, 01:52 AM -
loop "play again" in an 8 ball game , loops but wont let me answer my "out.print"
By IareSmart in forum New To JavaReplies: 1Last Post: 02-01-2012, 08:37 PM -
how to override "cancel operation" in "progress bar"
By singswt in forum SWT / JFaceReplies: 2Last Post: 10-08-2009, 11:28 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks