Last active
May 26, 2021 10:06
-
-
Save wiwi-git/da85a495ce21f12094a1f4897f899dd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let stringWithMathematicalOperation: String = "(34+2)/3*12-39" | |
let exp: NSExpression = NSExpression(format: stringWithMathematicalOperation) | |
let result: Double = exp.expressionValue(with:nil, context: nil) as! Double |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment