public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0,ValueEval arg1) {String arg;int index;try {arg = evaluateStringArg(arg0, srcRowIndex, srcColumnIndex);index = 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);}

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);}
