|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Replace the nth occurenceby Kenosis (Deacon) |
| on Nov 21, 2012 at 07:22 UTC ( #1004858=note: print w/ replies, xml ) | Need Help?? |
|
I like your solution for replacing the nth occurrence of a character within a string. I don't know whether the following is a 'better suggestion,' but what about initializing $n (for the nth) to the desired occurrence:
Output:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||