예제 #1
0
 public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)
 {
     try
     {
         String needle   = TextFunction.EvaluateStringArg(arg0, srcRowIndex, srcColumnIndex);
         String haystack = TextFunction.EvaluateStringArg(arg1, srcRowIndex, srcColumnIndex);
         return(Eval(haystack, needle, 0));
     }
     catch (EvaluationException e)
     {
         return(e.GetErrorEval());
     }
 }
예제 #2
0
 public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1,
                                    ValueEval arg2)
 {
     try
     {
         String needle   = TextFunction.EvaluateStringArg(arg0, srcRowIndex, srcColumnIndex);
         String haystack = TextFunction.EvaluateStringArg(arg1, srcRowIndex, srcColumnIndex);
         // evaluate third arg and convert from 1-based to 0-based index
         int startpos = TextFunction.EvaluateIntArg(arg2, srcRowIndex, srcColumnIndex) - 1;
         if (startpos < 0)
         {
             return(ErrorEval.VALUE_INVALID);
         }
         return(Eval(haystack, needle, startpos));
     }
     catch (EvaluationException e)
     {
         return(e.GetErrorEval());
     }
 }