Untitled
unknown
plain_text
a year ago
713 B
8
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