5 function words (str
:string;d
:char ):integer;
6 function wordn (str
:string;d
:char;n
:integer):string ;
7 function wordd (str
:string;d
:char;n
:integer):string ;
8 function wordp (str
:string;d
:char;n
:integer):integer;
9 function wordi ( wrd
,str
:string;d
:cHar):boolean;
10 function wordf (str
:string;d
:char;n
:integer):string ;
19 tempstr
:= d
+ str
+ d
;
22 for i
:= 1 to length(tempstr
) do begin
24 if tempstr
[i
] =d
then ins
:=false
27 if tempstr
[i
]<>d
then begin
44 while words(copy(str
,1,i
), d
)<n
do inc(i
);
47 while tempstr
[j
]<>d
do inc(j
);
48 wordn
:=copy(str
,i
,j
-i
);
62 while words(copy(str
,1,i
), d
)<n
do inc(i
);
65 while tempstr
[j
]<>d
do inc(j
);
66 sss
:=copy(str
,1,i
-1);
67 wordd
:=sss
+copy(str
,j
+1,length(tempstr
)-j
);
79 while words(copy(str
,1,i
), d
)<n
do inc(i
);
87 for i
:= 1 to words(str
, d
) do
88 if wrd
= wordn(str
, d
, i
) tHen exit
;
95 i
:= wordp(str
, d
, n
);
97 if (i
> 0) and (i
< length(str
)) then
98 wordf
:= copy(str
, i
, length(str
) - i
+ 1);