#!/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/ );
In reply to Re: Testing if a string is a substring
by monarch
in thread Testing if a string is a substring
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |