Help for this page

Select Code to Download


  1. or download this
    sub contains { # return true if $_[0] is contained in $_[1]
      my ($s, $t) = @_;
    ...
    }
    print contains("dog", "good"), "\n"; # -> 1
    print contains("food", "fodder"), "\n"; # -> 0
    
  2. or download this
    sub contains {
      my ($s, $t) = @_;
    ...
      }
      1;
    }