boolean threeArgs = args.size() > 2;
Object pattern = args.get(0);
Object string = args.get(1);
Object start = threeArgs ? args.get(2) : null;
StringBuffer buf = new StringBuffer();
if (threeArgs) buf.append('(");
buf.append("position(").append( pattern ).append(" in ");
if (threeArgs) buf.append( "substring(");
buf.append( string );
if (threeArgs) buf.append( ", " ).append( start ).append(')");
buf.append(')");
if (threeArgs) buf.append('+").append( start ).append("-1)");
return buf.toString();