Perl
Chilkat2 Perl
StringBuilder GetAfterBetween
Demonstrates the GetAfterBetween method.Chilkat Perl Downloads
use strict;
use warnings;
use Chilkat2;
my $sb = Chilkat2::StringBuilder->new;
$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...
my $searchAfter = '<company>';
my $companyName = $sb->GetAfterBetween($searchAfter, '<name>', '</name>');
print 'Company Name = ', $companyName, "\n";