I'm using NSExpression
to evaluate a formula in a string.
Example -
NSString *formula = @"7+11";
NSExpression *exp = [NSExpression expressionWithFormat: formula];
NSNumber *expResult = [exp expressionValueWithObject:nil context:nil];
Everything works just fine but...
What if I have the following formula "7+x=18"? How can I evaluate this formula and find "x" and get the result 11?
Original Answer here