Splitting a field containing people's names

Can anyone point me to the function I need to split a text field called “Full_Name” into two fields called “First_Name” and “Last_Name”?

The Full_Name field contains names of mixed length and number of text parts, example:
Kevin Crane
John Neal Smith
Bill Preson-Billet

I’m happy to split out the first part of the text into First_Name and whatever is left into Last_Name.

Hi Kevin,

Here is my very simplified solution. I just assumed that the last space in a string is the delimiter. Everything before is the first name and everything after is the last name.

$out.0.first_name = substring($in.0.full_name, 0, lastIndexOf($in.0.full_name, " "));
$out.0.last_name = substring($in.0.full_name, lastIndexOf($in.0.full_name, " ")+1);

However, I admit this is not a universally valid rule. If you have more complex definitions of first names and last names, you may find useful also split function. For instance:

string[] names = split($in.0.full_name, " ");
$out.0.first_name = names[0];
$out.0.middle_name = names[1];
$out.0.flast_name = names[2];

Regards,