Sample code for 30+ languages & platforms
Delphi ActiveX

StringBuilder GetAfterBetween

Demonstrates the GetAfterBetween method.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
sb: TChilkatStringBuilder;
searchAfter: WideString;
companyName: WideString;

begin
sb := TChilkatStringBuilder.Create(Self);
sb.Append('<abc><person><name>Joe</name></person><company><name>Chilkat Software</name></company></abc>');

// The GetAfterBetween method gets the substring between two arbitrary marker strings, and doesn't
// start searching until the searchAfter string is passed.

// For example, to get the company name in the string above...
searchAfter := '<company>';
companyName := sb.GetAfterBetween(searchAfter,'<name>','</name>');
Memo1.Lines.Add('Company Name = ' + companyName);
end;