Sample code for 30+ languages & platforms
Perl Requires Chilkat v9.5.0.77+

StringBuilder RemoveBefore

Demonstrates the StringBuilder.RemoveBefore method.

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $sb = Chilkat2::StringBuilder->new;
my $success = $sb->Append('http://www.chilkatsoft.com');

# The RemoveBefore method removes the chars up to and including the marker string.
# If the marker is not found, then nothing is removed and the method returns 0.
my $marker = '//';
my $bFound = $sb->RemoveBefore($marker);

print 'bFound = ', ($bFound ? 1 : 0), "\n";
print 'sb contains: ', $sb->GetAsString(), "\n";

# Output is:
# bFound = 1
# sb contains: www.chilkatsoft.com