dear perl gurus

can someone suggest a design/approach on solving the following requirement:

there is a string, say $ss, that is contained in a longer string, say $ls.
for example $ss = "jumps over" and $ls = "the cow jumps over the moon"

how do you suggest obtaining a string from $ls that is $n characters to
the both left and right of $ss?

for example and using the above, say $n = 4
so the results would be "cow jumps ove" (notice 4 characters to both the
left and right of the target text $ss.

any approach would be much appreciated!

mario sanchez

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to