in reply to Testing if a string is a substring
#!/usr/bin/perl -w use strict; my $super = 'AAAAATT'; my $sub = 'AT'; # Returns 1 (True) #my $sub = 'AAA'; # Returns 1 (True) #my $sub = 'GGG'; # Returns 0 (False) print "1\n" if ( $super =~ m/\Q$sub\E/ );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing if a string is a substring
by reasonablekeith (Deacon) on Jul 20, 2005 at 08:58 UTC |