Delete(S, 1, Pos(' ', S)); b:=length(s); while (b > 1) and (S[b]<>' ') do Dec(b); Delete(S, b, Length(S)-(b+1));