Solved

url parsing - delphi

Posted on 2011-03-18
4
570 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

840 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