Janilabo

Janilabo | StartsWith() [Simba]

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