blob: 597dc8c93380a52328f6db23bfefc6721204a0cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
{$mode objfpc}
{$H+}
uses sysutils;
Function AnsiEndsStr(const ASubText, AText: string): Boolean;
begin
Writeln('ZZ',ASubText,'XX ',AText,'YY');
Result := AnsiCompareStr(Copy(AText,length(AText)-length(ASubText)+1,length(ASubText)),ASubText)=0;
end;
VAR
s: WideString;
t: WideString;
err : boolean;
BEGIN
s := 'This is a test.'#961#967;
t := 'test.'#961#967;
IF AnsiEndsStr(t, s) THEN
WriteLn('OK.')
ELSE
err:=true;
IF AnsiEndsStr('test.'#961#967, s) THEN
WriteLn('OK.')
ELSE
err:=true;
if err then
WriteLn('Not OK.');
if err then
halt(1);
END.
|