in reply to Re: Re: How to remove middle of string?
in thread How to remove middle of string?

The four-argument usage of perlfunc:substr will do what you are looking for. For example:

my $string = "foo bar baz"; my $replacement = "moo"; # This will print "foo moo baz" print substr($string, 4, 3, $replacement), "\n";