How to get maximum length of a string

have a look here