Start with names like this...
Mary Jo Louise Smith
Mary Jo Smith
Mary Smith
and end up with names like this... Last Name First Name Middle Names
Smith Mary Jo Louise
Smith Mary Jo
Smith Mary
My Solution
Code: Select all
Name = Mary Jo Louise Smith
;Name = Mary Jo Smith
;Name = Mary Smith
StringSplit,OutPutArray,Name,%a_space%
LastName := OutPutArray%OutPutArray0%
OutPutArray0--
Loop %OutPutArray0%
TheRest := ( TheRest a_space OutPutArray%a_index% )
LastNameFirst := (LastName TheRest)
Loop % OutPutArray0+1 ;clear Array variables
OutPutArray%a_index% =
MsgBox % LastNameFirst