public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) {double s0;String s1;try {s0 = evaluateDoubleArg(arg0, srcRowIndex, srcColumnIndex);s1 = evaluateStringArg(arg1, srcRowIndex, srcColumnIndex);} catch (EvaluationException e) {return e.getErrorEval();}try {String formattedStr = formatter.formatRawCellContents(s0, -1, s1);return new StringEval(formattedStr);} catch (Exception e) {return ErrorEval.VALUE_INVALID;}}
public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0,ValueEval arg1){String arg;int index;try{arg = TextFunction.EvaluateStringArg(arg0, srcRowIndex, srcColumnIndex);index = TextFunction.EvaluateIntArg(arg1, srcRowIndex, srcColumnIndex);}catch (EvaluationException e){return e.GetErrorEval();}if (index < 0){return ErrorEval.VALUE_INVALID;}String result;if (_isLeft){result = arg.Substring(0, Math.Min(arg.Length, index));}else{result = arg.Substring(Math.Max(0, arg.Length - index));}return new StringEval(result);}