Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.04.22;
Скачать: CL | DM;

Вниз

Помогите решить проблему   Найти похожие ветки 

 
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;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.011 c
14-69978
ATLANTIDO
2002-03-10 20:06
2002.04.22
WinXP - Ctrl+Alt+Del ?


14-70018
Alexandr
2002-03-15 11:38
2002.04.22
Поцарапанный экран монитора


7-70050
AntBofh
2002-01-23 22:09
2002.04.22
COM порт ... и мой ... Модем


1-69794
Yakudza
2002-04-09 17:49
2002.04.22
TButton


6-69955
Трактор
2002-02-08 18:26
2002.04.22
Internet