• Post Reply Bookmark Topic Watch Topic
  • New Topic

Perform calculation on String  RSS feed

 
stuart armstrong
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Does anyone know of any java code that can be used to perform a calculation on a string. e.g "(10*2)+3" - The code would return 23 as a double.

Thanks for any help
 
Mark Dexter
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. A quick Google search of "java string parse math" turned up a bunch of links, including the ones below. Hope this helps. Mark Dexter

http://www.singularsys.com/jep/doc/html/index.html

http://www.eteks.com/jeks/en/doc/com/eteks/parser/JavaSyntax.html

http://freshmeat.net/projects/expression-tree/

http://sourceforge.net/projects/expression-tree/
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JEP -the first of the links Mark posted- is a good one.
 
stuart armstrong
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that, the fourth link has just what I need.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!