Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Check if one string is a substring of another.

by jbrugger (Parson)
on Feb 14, 2006 at 10:18 UTC ( #530075=note: print w/ replies, xml ) Need Help??


in reply to Check if one string is a substring of another.

To add to the next comments, if you want to see what string is longer, use length  length $st1 so you can check the longest one, as i understand you need that

#so you get something like this: my $index = 0; if ( lenght $str1 < length $str2 ) { $index= index $str2,str1; } else { $index= index $str1,str2; }


"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.


Comment on Re: Check if one string is a substring of another.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://530075]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2015-07-07 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls