【发布时间】:2016-11-18 11:01:17
【问题描述】:
如何执行此任务?
int Amount, x=1000,y=200;
string BasedOn="x*12/100+y*5/100";
//In place of x and y in BasedOn I want to replace with x,y values like (1000*12%+200*5%)
//and the calculated result(130) should be assigned to Amount variable
现在,我拆分了 BasedOn 字符串
string[][] strings = BasedOn
.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries)
.Select(w => w.Split('*').ToArray())
.ToArray();
接下来要做什么?请帮帮我。
【问题讨论】:
标签: c# string multidimensional-array