Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: regex and substrings

by jeffenstein (Hermit)
on Jul 23, 2018 at 15:57 UTC ( [id://1219115]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if( index($str1, $str2) > -1 && $str1 ne $str2 ){
        print "$str2 is a substring of $str1\n";
    }
    
  2. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        my ($substring, $string) = @_;
        return 1 if index($string, $substring) > -1 && $string ne $substri
    +ng;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found