Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: regex and substrings

by jeffenstein (Friar)
on Jul 23, 2018 at 15:57 UTC ( #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
Node Status?
node history
Node Type: note [id://1219115]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2021-01-21 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?