Solved

url parsing - delphi

Posted on 2011-03-18
4
566 Views
Last Modified: 2012-05-11
Hello experts.Please help me.
i have a trouble.

i a memo1.lines are string like this : C:\temp\11.zip|C:\program files......

i have wrote a code that need to parse first dir adress and second
var
localfile,secondfile,total : string;
begin
total := Memo1.Lines[0];
total := localfile + '|' + second;
showmessage(localfile);
showmessage(second);

But this not work.
please help me.
Thanks.
0
Comment
Question by:helyonprime96
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 35163702
use a TStringList


var
  Temp: TStrings;
begin
  Temp := TStringList.Create
  try
    Temp.StrictDelimiter := True;
    Temp.Delimiter := '|';
    Temp.DelimitedText := Memo1.Lines[0];
    showmessage(Temp[0]);
    showmessage(Temp[1]); 
  finally
    Temp.Free;
  end;

Open in new window

0
 

Author Comment

by:helyonprime96
ID: 35163707
ok.thanks.

please help
how can i delimite proxy host and port?

with this code?
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35163742
var
  Str:string;
begin
  str:=Memo1.Lines[0]+'|'; // or str:=Memo1.Text+'|';
  while pos('|',Str) > 0 do
    begin
      ShowMessage(copy(str,1,pos('|',Str)-1));
      delete(str,1,pos('|',Str));
    end;
end;

Open in new window

0
 

Author Closing Comment

by:helyonprime96
ID: 35164244
thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi component that can load a DLL in design time? 8 53
split53 challenge 7 77
Beginner to Unreal Engine 4 5 57
how to change, disabled button color FMX ? 1 9
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now