Add substr function.