in reply to substring function
Or, if you just want to use substr:s/\s*$/\n/s; # assuming \s will catch your newline s/\s*[\r\n]+$/\n/; # otherwise, this should do it
substr($_, -2, 2) = undef; # deletes last 2 characters substr($_, -3, 3) = "\n"; # if your string ends in a newline
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: substring function
by Anish (Novice) on Sep 29, 2000 at 22:36 UTC | |
by Fastolfe (Vicar) on Sep 30, 2000 at 01:16 UTC |