craigt has asked for the wisdom of the Perl Monks concerning the following question:
Below is a string example where I;m trying to substitute ? for # and % for &.
#Result& The percent of births as healthy births has increased in recent years in response to the Healthy Births initiative.:#Approach& The prenatal, birthing, and postpartum parts of the birth process have been changed substantially. We will have a brighter day to look forward to.:#Prospect& If the same old pace of this change continues, it will be a wonderful day.
I'm just using simple substitution.
$analysis =~ tr/#/?/; $analysis =~ tr/&/%/;
I've tried this escaping these characters with no luck.
The tr suggested failed. Some of the characters may need to be escaped.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: problem changing string characters (updated)
by haukex (Archbishop) on May 24, 2019 at 17:36 UTC | |
by craigt (Acolyte) on May 24, 2019 at 17:52 UTC |