Is there way to solve the string equations in ios ?
ios
For example
Input:
NSString * str =@\"1+2\";
Output:
<
You can use NSExpression for this:
NSExpression *expression = [NSExpression expressionWithFormat:@"1+2"]; NSLog(@"%@", [expression expressionValueWithObject:nil context:nil]);
For further information read the documentation of the used methods.