Rename cut function to do_substr