find the max substr in a string