class Strings {

    public static String sanitizeIdentifierName(String identifier) {
        if ( identifier != null && identifier.length() > 0 ) {

            int firstAlphabeticIndex = 0;
            while ( firstAlphabeticIndex < identifier.length() &&
                ( identifier.charAt( firstAlphabeticIndex ) == UNDERSCORE ||
                    Character.isDigit( identifier.charAt( firstAlphabeticIndex ) ) ) ) {
                firstAlphabeticIndex++;
            }

            if ( firstAlphabeticIndex < identifier.length()) {
                // If it is not consisted of only underscores
                return identifier.substring( firstAlphabeticIndex ).replace( "[]", "Array" );
            }

            return identifier.replace( "[]", "Array" );
        }
        return identifier;
    }

    private  Strings();

}