Advertisement
Guest User

Untitled

a guest
Dec 26th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. unit StringUtils;
  2.  
  3. interface
  4.  
  5. function EndsWith(const Value: string; const SubString: string): Boolean;
  6. function StartsWith(const Value: string; const SubString: string): Boolean;
  7.  
  8. implementation
  9.  
  10. uses
  11. StrUtils;
  12.  
  13. function EndsWith(const Value: string; const SubString: string): Boolean;
  14. begin
  15. // EndsStr is not symmetric to StartsStr and fails to handle empty SubString.
  16. if SubString = '' then
  17. Result := True
  18. else
  19. Result := EndsStr(SubString, Value);
  20. end;
  21.  
  22. function StartsWith(const Value: string; const SubString: string): Boolean;
  23. begin
  24. Result := StartsStr(SubString, Value);
  25. end;
  26.  
  27. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement