Форум: "Базы";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
ВнизПомогите решить проблему Найти похожие ветки
← →
Johnmen (2002-04-01 13:43) [5]Вот тебе пример из RxLib :
function WordCount(const S: string; const WordDelims: TCharSet): Integer;
var
SLen, I: Cardinal;
begin
Result := 0;
I := 1;
SLen := Length(S);
while I <= SLen do begin
while (I <= SLen) and (S[I] in WordDelims) do Inc(I);
if I <= SLen then Inc(Result);
while (I <= SLen) and not(S[I] in WordDelims) do Inc(I);
end;
end;
function ExtractWord(N: Integer; const S: string;
const WordDelims: TCharSet): string;
var
I: Integer;
Len: Integer;
begin
Len := 0;
I := WordPosition(N, S, WordDelims);
if I <> 0 then
{ find the end of the current word }
while (I <= Length(S)) and not(S[I] in WordDelims) do begin
{ add the I"th character to result }
Inc(Len);
SetLength(Result, Len);
Result[Len] := S[I];
Inc(I);
end;
SetLength(Result, Len);
end;
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
Память: 0.43 MB
Время: 0.008 c