Help for this page

Select Code to Download


  1. or download this
    my $string = "--This is a comment\nNot a comment\n" .
        "--This Comment continues here\nNOT a comment";
    
  2. or download this
    my $string = "...";
    
    $string =~ s/(^|\n)--[^\n]+//g;
    
    print "No comments: $string\n";
    
  3. or download this
    my $string = "...";
    
    ...
    $string =~ s/^--[^\n]+\n//;
    
    print "No comments: $string\n";