helyonprime96
asked on
String function in delphi
Hello experts!
Please help me.
I have a list of websites.
I need to create a function that determinates what is the site extension (.ru or .com)
Plese help me.
Thanks
Please help me.
I have a list of websites.
I need to create a function that determinates what is the site extension (.ru or .com)
Plese help me.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
please help me, how i can see this text between
<td valign="top">
and </td>
thanks
<td valign="top">
and </td>
thanks
try
procedure TForm3.Button1Click(Sender
begin
ShowMessage(GetTopLevelDom
end;
function GetTopLevelDomain(const AURL: string): string;
var
Index: Integer;
Temp: string;
begin
Result := '';
Temp := Trim(AURL);
Index := Pos('//', AURL);
if Index > 0 then
begin
Inc(Index, 2);
Temp := Copy(Temp, Index, Length(Temp) - Index);
end;
Index := Pos('/', Temp);
if Index > 0 then
Temp := Copy(Temp, 1, Index-1);
Index := Length(Temp);
while (Index > 0) and (Temp[Index] <> '.') do
begin
Result := Temp[Index] + Result;
Dec(Index);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
str:string;
begin
str:=Memo1.Text;
repeat
delete(str,1,pos('<td valign="top">',str)+ length('<td valign="top">')-1);
showmessage(trim(copy(str,1,pos('</td>',str)-1)));
until pos('<td valign="top">',Str) <= 0;
end;
Now I lost some points ;-)
EE works this way: All new questions are always posted separately as long as they are not directly related to the original question (or answering them does not provide further clarification for it).
ASKER