in reply to Replacing a given character starting with the xth occurence in a string
Um, I'm pretty new to perl, but your problem is very simple really. I think everyone has tried to make it much more complicated a problem than it really is.
Try this:
p$ will then contain "T1rr1nc1 and Phillip ar1 sw11t", I think you'll find.#!/usr/perl -w my p$ = 'Terrence and Phillip are sweet'; p$ =~ s/w/1/g;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Replacing a given character starting with the xth occurence in a string
by quent (Beadle) on May 21, 2001 at 10:25 UTC | |
by Anonymous Monk on May 21, 2001 at 10:50 UTC | |
by davorg (Chancellor) on May 21, 2001 at 15:37 UTC |
In Section
Seekers of Perl Wisdom