问题描述
您好,
我在ipad的objective-c项目中面临以下问题,也许有人有解决方案。
我需要解析复杂的表达式,例如:(5 + 6i)(4-8i)(和许多更复杂的表达式)。
目前我需要找到一种方法来转换一串这样的表达式代码。例如:
string expression =(5 + 6i)(4-8i);
成:
复数复合表达式解析=(5 + 6i)(4-8i); (这给出了正确的答案)
换句话说,是否有一种简单的方法将字符串转换为代码?
Hello,
I'm faced with the following problem in my objective-c project for the ipad, maybe somebody has a solution.
I need to parse complex expressions such as: (5+6i)(4-8i) (and many much more complex expressions).
At the moment I need to find a way to convert a string of such an expression into code. For example:
string expression = "(5+6i)(4-8i)";
into:
double complex expressionSolution = (5+6i)(4-8i); (this gives the right answer)
In other words, is there a simple way to convert a string into code?
推荐答案
这篇关于目标c:将字符串转换为代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!