implement NaryFunction
add substr(str, begin, end) function.