i am making a calculator as my first app and i want that user can enter a complete statement as string eg. "4+5-6*1".. can anyone tell me how to get a result from such a string?
Have you tried eval ?
eval("4+5-6*1") -> 3
You can get result using string function like split function and after you get individual object do your calculation.
Think you can help? Login to answer this question!