Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SearchingLastWord(var S: String): String;
- var
- i, j, k: Integer;
- LastW: String;
- begin
- i := Length(S);
- while not (((S[i] >= 'a') and (S[i] <= 'z')) or ((S[i] >= 'A') and (S[i] <= 'Z'))) do
- Dec(i);
- k := i;
- while ((S[i] >= 'a') and (S[i] <= 'z')) or ((S[i] >= 'A') and (S[i] <= 'Z')) do
- Dec(i);
- LastW := '';
- for j := i + 1 to k do
- LastW := LastW + S[j];
- SearchingLastWord := LastW;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement