Scanning a string for a delimitor character

I'd like to scan a string for a character, here's an example, I'd like to scan boot.ini(from WinNT) for the char ", so that I can extract the OS label.  Anyone have any ideas?

Flinn Mueller
evolvelabsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
Hi
this source below scans the text from a memo for the | delimiter ( change to whatever your delimiter is) and splits the text into 3 edits (i know there is 4 | in my text).
if you want i can send the demo that goes with the code below i did a while back for a test so you can visulise it better.
Regards Barry

unit gettext;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,shellapi;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Memo1: TMemo;
    Edit3: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
sl   : tstringlist;
i,j  :integer;
s,ss :string;      //ss is holding substring
begin
sl := TStringList.Create;
sl.Add(memo1.lines[0]);
 For I := 0 to SL.Count - 1 do
          begin
            S := sl[i];
            for J := 0 to 3 do
            begin
              If pos('|',s) > 0 then
              begin
                SS := Trim(copy(S,1,pos('|',s)-1));
                try
                  Case J of
                    1 : edit1.text := SS;
                    2 : edit2.text := SS;
                    3 : edit3.text := SS;
                   end;
                except
                  raise;
                  end;
              end;
             Delete(S,1,pos('|',s));
            end;
     end;
end;

end.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
intheCommented:
my text in the memo looked like:

| this is a demo of | getting the text from between a delimiter | does it help you? |
0
evolvelabsAuthor Commented:
This is exactly what I needed, I was checking out strpos, but wasn't quite sure how to use it.
0
intheCommented:
glad to hear ;-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.