using IwbZero.Expr; namespace IwbZero.ExprFunctions.Functions { /// /// Format字符串 /// public class FunFormatStr:IIwbFunction { public string Invoke(ExprObject exprObj) { string text = ""; ExprObject child = exprObj.GetChild(0); if (child != null) { text = child.Expr; if (exprObj.ChildCount > 1) { object[] array = new object[exprObj.ChildCount / 2]; for (int i = 2; i < exprObj.ChildCount; i++) { if (i % 2 == 0) { int num = i / 2 - 1; array[num] = exprObj.GetChild(i).Expr; } //int num = i / 2 - 1; //if ((num + 1) * 2 == i) //{ // array[num] = exprObj.GetChild(i).Expr; //} } text = string.Format(text, array); } } return text; } } }