On Sat, 30 Oct 2004 22:46:39 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> My earlier post was not quite clear. I will explain my problem in
> detail here.
> 
> I have a string whose length is say 5. I need to copy another string
> into this string but from an offset of 10.
> I tried using substr but this is a limitation of substr and it gave me
> a fatal error.
> Is there any other function, method which will allow me to do so ?
> 
> Manas.


Yes, "rindex" is what (I think) you want; here is a small example of its use:

my($newString)     =  substr($currentString, (rindex($currentString,
"searchString") + length("searchString".$replacementString)));


Although, John's reply to you first post was better.

-- 
WC -Sx- Jones
http://youve-reached-the.endoftheinternet.org/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to