I need to call this function over a big dataset. I need it to be as efficient as possible but still be readable. Can I make it anymore efficient by using a different function for capitalize or blank check?public static String nameFormat(String title, String firstname, String lastName) {    if (StringUtils.isBlank(firstname) && StringUtils.isBlank(lastName)) {        return Unknown;    }    StringBuilder fullNameSB = new StringBuilder(lastName.trim().toUpperCase());    fullNameSB.append(, );    fullNameSB.append(WordUtils.capitalizeFully(firstname.trim()));    if (title != null) {        fullNameSB.append( );        // replace (mr.) with mr        title = title.trim().replaceAll(\\.|\\)|\\(, );        fullNameSB.append(();        fullNameSB.append(WordUtils.capitalize(title));        fullNameSB.append());    }    //Remove any double spaces that might be in a multipart first or surname    return fullNameSB.toString().replaceAll(  , );}
Formatting Bond, JAMES (Mr)
java;performance;strings;formatting