Perl Requires Chilkat v9.5.0.77+
Chilkat2 Perl
StringBuilder RemoveAfterFinal
Demonstrates the StringBuilder.RemoveAfterFinal method.Chilkat Perl Downloads
use strict;
use warnings;
use Chilkat2;
my $sb = Chilkat2::StringBuilder->new;
my $success = $sb->Append('abc::def::ghi');
# Replace the 1st occurrence of a substring with another string.
my $bFound = $sb->ReplaceFirst('::', '-');
print 'bFound = ', ($bFound ? 1 : 0), "\n";
print 'sb contains: ', $sb->GetAsString(), "\n";
# Output is:
# bFound = True
# sb contains: abc-def::ghi