How would I pass a function as an argument to a UDF?

For example:

=MyUDF(arg1, arg2, arg3)

where arg1 might be a literal text string, a reference to a cell containing a
string, OR a formula that returns a string:

SUBSTITUTE(A1,old_text,new_text)

I want to manipulate the resultant string in my UDF.

Thanks.
--ron