Seperating out text from one field

I have a field in a database which is populated by three strings
seperated by a pipe (|)

Lastname|firstname|Title

I am trying to seperate them out to populate fields on my form, but
keep getting different results depending on the length of the values:

Hayward|Alistair|mr gives me                    LastName: Hayward
                                                Firstname: Alistair
                                                Title : r|Mr

Moore|Sharon|ms gives me                    Lastname :Moore
                                            Firstname: Sharon
                                            Title: Ms

Brown|John|Mr gives me                  LastName: Brown
                                        Firstname: n
                                        Title:
Nothing for the last title.....

Here's my code: 'EmailAddr' is where I store the three joined
strings......

  NameStr := fieldByName('EmailAddr').AsString;

  editLastName.Text := LeftStr(NameStr,pos('|',NameStr)-1);
  NameStr := RightStr(NameStr,Pos('|',NAmeStr)+3);
  editFirstName.Text := LeftStr(NameStr,pos('|',NameStr)-1);

  NameStr := RightStr(NameStr,Pos('|',NAmeStr));
  NameStr := RightStr(NameStr,Pos('|',NAmeStr)-1);
  NameStr := RightStr(NameStr,Pos('|',NAmeStr));

  editTitle.Text := NameStr;