To find largest word from string (if condition not working in while loop)