in reply to [Solved]: How to append a string at the end of another string using substr
This works for me:
Update: if you don't know the length of the string, use length($string) :-)
my $string1 = "Hello"; my $string2 = " World"; substr($string1, length($string1), 1, "$string2"); print "$string1\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to append a string at the end of another string using substr
by AnomalousMonk (Archbishop) on Jul 14, 2015 at 18:35 UTC | |
by Perl300 (Friar) on Jul 14, 2015 at 19:02 UTC |