Fails for bogus start/stop
function substring input String str; input Integer start "start index, first character is 1"; input Integer stop "stop index, first character is 1"; output String out "Length is stop-start+1"; end substring;