- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
function ReplaceUrl(txt: WideString): WideString;
var
i, j: integer;
tmp, Url: WideString;
begin
Result := '';
I := 1;
while I <= Length(txt) do
begin
tmp := '';
if WideSameText(tmp + txt[i]+txt[i+1]+txt[i+2]+txt[i+3]+txt[i+4]+txt[i+5]+txt[i+6], 'http://') or
WideSameText(tmp + txt[i]+txt[i+1]+txt[i+2]+txt[i+3]+txt[i+4]+txt[i+5]+txt[i+6], 'ed2k://') or
WideSameText(tmp + txt[i]+txt[i+1]+txt[i+2]+txt[i+3]+txt[i+4]+txt[i+5], 'ftp://') or
WideSameText(tmp + txt[i]+txt[i+1]+txt[i+2]+txt[i+3], 'www.') or
WideSameText(tmp + txt[i]+txt[i+1]+txt[i+2]+txt[i+3]+txt[i+4]+txt[i+5]+txt[i+6]+txt[i+7], 'https://') then
begin
Url := '';
for j := I to Length(txt) do
begin
if (txt[j] <> ' ') and (ord(txt[j]) < 255) then
Url := Url + txt[J]
else
Break;
end;
Result := Result + Format(C_HTML_URL, [Url, Url]);
I := J;
end else
begin
Result := Result + txt[I];
Inc(I);
end;
end;
end;
bormand 21.08.2012 13:15 # 0
bormand 22.08.2012 15:53 # 0