Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit StringUtils;
- interface
- function EndsWith(const Value: string; const SubString: string): Boolean;
- function StartsWith(const Value: string; const SubString: string): Boolean;
- implementation
- uses
- StrUtils;
- function EndsWith(const Value: string; const SubString: string): Boolean;
- begin
- // EndsStr is not symmetric to StartsStr and fails to handle empty SubString.
- if SubString = '' then
- Result := True
- else
- Result := EndsStr(SubString, Value);
- end;
- function StartsWith(const Value: string; const SubString: string): Boolean;
- begin
- Result := StartsStr(SubString, Value);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement