Untitled

 avatar
unknown
plain_text
5 months ago
713 B
5
Indexable
                var fullName = contact.getName();
                newCustomerContact.setNameFirst(fullName);
                newCustomerContact.setNameLast(fullName);
                if(fullName.contains(Constants.SPACE)) {
                    var fullNameSplit = fullName.split(Constants.SPACE);
                    newCustomerContact.setNameFirst(fullNameSplit[0]);
                    newCustomerContact.setNameLast(fullNameSplit[fullNameSplit.length - 1]);
                    if(fullNameSplit.length > 2) {
                        newCustomerContact.setNameMiddle(String.join(Constants.SPACE, Arrays.copyOfRange(fullNameSplit, 1, fullNameSplit.length - 1)));
                    }
                }
Editor is loading...
Leave a Comment