Благодарим вас за помощь Мауро, хотя я понял это сегодня утром, прежде чем проверять здесь. Это ответ, для кого-то, кто мог бы работать в этом в будущем:
Crush the Name if it has more than one space in it
For example: "Alexander The Great" Becomes "Alexander TheGreat",
"John" stays as "John", "Doc Holiday" stays as "Doc Holiday"
"Alexander The Super Great" becomes "Alexander TheSuperGreat" and
so on and so forth.
FirstSpacePosition := POS(' ',LT.Name);
s := Copy(LT.Name,1,FirstSpacePosition);
s2 := Copy(LT.Name,FirstSpacePosition,Length(LT.Name));
s := StripAllSpaces(s);
s2 := StripAllSpaces(s2);
Insert(' ',s,(Length(s)+1));
LT.Name := s+s2;
StripTrailingBlanks2(LT.Name);
StripLeadingBlanks(LT.Name);
И StripAllSpaces функция выглядит следующим образом:
FUNCTION StripAllSpaces(s3:STRING):STRING;
BEGIN
WHILE POS(' ',s3)>0 DO Delete(s3,Pos(' ',s3),1);
StripAllSpaces:=s3;
END;{StripAllSpaces}
And The StripLeadingBlanks/StripTrailingBlanks функции выглядит следующим образом:
PROCEDURE StripTrailingBlanks2(var Strg: string);
BEGIN
while Strg[Length(Strg)] = ' ' do
Delete(Strg, Length(Strg), 1);
END; { END StripTrailingBlanks }
PROCEDURE StripLeadingBlanks(var Strg: string);
BEGIN
While (Length(Strg) > 0) and (Strg[1] = ' ') do
Delete(Strg, 1, 1);
END; { END StripLeadingBlanks }