in reply to Remove newline character from start of string
As a regex:
$str =~ s{^\Q$/\E}{};
With substr:
if (substr($str, 0, length($/)) eq $/) { substr($str, 0, length($/), ''; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Remove newline character from start of string
by Roy Johnson (Monsignor) on May 10, 2010 at 15:29 UTC |