This tip was submitted to the SearchDomino.com tip library by member Michael Kinder. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.
VIEW MEMBER FEEDACK TO THIS TIP
The code below can be used in view columns or wherever else you may need to reorder the CommonName portion of a UserName. For example, you may want to put the name LastName , FirstName MiddleInitial(if it exists). Or you could change it around any way necessary.
rs := @ReplaceSubstring(@Name ([CN]; NotesName); " "; ";"); exp := @Explode(rs; ";"; 0); ele := @Elements(exp); @If(ele=3; @Subset(exp; -1) + " , " + @Subset(exp; 1) + " " + @Subset(@Subset(exp; 2); -1); @Subset(exp; -1) + " , " + @Subset(exp; 1))
Michael Kinder's four-step solution to reversing first and last names can be simplified. However, neither his method nor the above below handles suffixes, such a Jr. or III. Here's how to do it:
fullname := @Name ([CN]; @UserName); lastname := @RightBack (fullname; " "); firstname := @Left (fullname; lastname); @Trim (lastname + "; " + firstname)
Do you have comments on this tip? Let us know.