How to check if the string is empty or not