How to extract a last name that has a prefix from a text field? (e.g., Van Gogh, , da Vinci)
Hello!
I am creating an auto-fill PDF sheet that requires information to be repeatedly filled in various locations across the packet. It is to be filled in with client info, and in this specific case, their name.
I currently am using a text field "Full Name" where they enter first and last. I have a second text field "First Name" that extracts their first name and another for their last name using a field "Last Name." Their are various locations they would need to fill in their full name and then their first and last separately.
I am using this calculation script to extract their first and last to the separate fields I named above:
event.value = this.getField("First.Names").valueAsString.split(" ")[0];
I'm just wondering how I could use this script to also extract last names that include prefixes, so if their full name is Vincent van Gogh, the last name field will be populated with van Gogh instead of just Gogh.
Any help is appreciated! Thanks!
