public static String ensureLeft ( final String value , final String prefix , final boolean caseSensitive ) { validate ( value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; if ( caseSensitive ) { return value . startsWith ( prefix ) ? value : prefix + value ; } String _value = value . toLowerCase ( ) ; String _prefix = prefix . toLowerCase ( ) ; return _value . startsWith ( _prefix ) ? value : prefix + value ; }
Ensures that the value begins with prefix . If it doesn t exist it s prepended .