public static boolean startsWith(String str, char prefix) {
	return str != null && str.length() > 0 && str.charAt(0) == prefix;
    }
public static boolean startsWith ( String str , char prefix ) { return str != null && str . length ( ) > 0 && str . charAt ( 0 ) == prefix ; }
Tests if this string starts with the specified prefix.

@param str string to check first char
@param prefix the prefix.
@return is first of given type