in reply to Needing to take out 3rd word of sting
The third word would be $words[2] so you'd create the string again without that word:@words = split ' ', $string;
Keep the array of words, and when you need to put it back in simply do:for($i=0;$i<scalar(@words);$i++){ $string .= $words[$i] unless $i==2; }
Hope this helpsfor($i=0;$i<scalar(@words);$i++){ $string .= $words[$i]; }
Cheers
Sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Needing to take out 3rd word of sting
by Abigail-II (Bishop) on Sep 24, 2003 at 19:37 UTC | |
|
Re: Re: Needing to take out 3rd word of sting
by seaver (Pilgrim) on Sep 24, 2003 at 19:31 UTC |