Janilabo

Janilabo | EndsWith() [Simba]

Jun 21st, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.30 KB | None | 0 0
  1. function EndsWith(s, str: string): Boolean;
  2. var
  3.   sL: Integer;
  4. begin
  5.   sL := Length(s);
  6.   if (s <> '') and (str <> '') then
  7.     Result := (s = Copy(str, (Length(str) - (sL - 1)), sL));
  8. end;
  9.  
  10. begin
  11.   ClearDebug;
  12.   if EndsWith('ST', 'TEST') then
  13.     WriteLn('YEP!')
  14.   else
  15.     WriteLn('NOPE.');
  16. end.
Advertisement
Add Comment
Please, Sign In to add comment