final int parameterCount = parameters.getParameterCount();
if (parameterCount < 1 || parameterCount > 2)
{
throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
}
final TypeRegistry typeRegistry = context.getTypeRegistry();
final Type textType = parameters.getType(0);
final Object textValue = parameters.getValue(0);
final Type searchTextType = parameters.getType(1);
final Object searchTextValue = parameters.getValue(1);
final String text = typeRegistry.convertToText(textType, textValue);
final String searchText = typeRegistry.convertToText(searchTextType, searchTextValue);
if (searchText.length() == 0)
{
return new TypeValuePair(NumberType.GENERIC_NUMBER, 0);
}