laziness, impatience, and hubris | |
PerlMonks |
Re: Check if one string is a substring of another.by mk. (Friar) |
on Feb 14, 2006 at 11:36 UTC ( [id://530097]=note: print w/replies, xml ) | Need Help?? |
perl -e '$s1="foofoo";$s2="foo";(length$s1<length$s2)?$check=index$s2,$s1:$check=index$s1,$s2;print "match\n" if $check>=0'
In Section
Seekers of Perl Wisdom
|
|