This is a check to see if the string is empty which is wise to so anyway.
And a check for the first character, which is a very cheap check.

Calling the code that comes after it only once when it isn't necessary is a lot more expensive than doing these simple checks on all.