3

Possible Duplicate:
Java: Parse a mathematical expression given as a string and return a number

Hello there,

I would like to ask you, if exist some way how to convert string "1+2+3" to math equation? Exist for this purpose some function or method in Java?

Thanks for hints.

Community
  • 1
  • 1
user1946705
  • 2,858
  • 14
  • 41
  • 58
  • 1
    I disagree that this is a dupe; that one wants the solution to the equation, but this one just wants it to become an equation object of some kind. – Pops Apr 14 '11 at 20:23

2 Answers2

1

This would necessarily depend on the implementation of the Equation class you're using. Check its API.

Pops
  • 30,199
  • 37
  • 136
  • 151
1

It's not part of the standard API.

But I implemented it in my project, you can have a look here. https://github.com/MarkyVasconcelos/Towel/wiki/Expression

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167