in reply to How do I cut single characters out of a string
I'm surprised that nobody has mentioned that substr returns an lvalue. In other words, you can assign to it.
my $string = 'mystring123456'; substr($string, 8, 1) = ''; print "$string\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I cut single characters out of a string
by johngg (Canon) on Jan 15, 2012 at 12:22 UTC | |
by tobyink (Canon) on Jan 15, 2012 at 12:53 UTC | |
|
Re^2: How do I cut single characters out of a string
by JavaFan (Canon) on Jan 15, 2012 at 02:44 UTC |