Help for this page

Select Code to Download


  1. or download this
    my $str = "ABC[GHI]XYZ";
    
    # Note that in actual situation string may contain several
    # such bracketed alphabets.
    
  2. or download this
    my @array = ("A", "B", "C", "GHI", "X", "Y", "Z");
    
  3. or download this
    perl -MData::Dumper -e '
    $str ="ABC[GHI]XYZ"; 
    @arr= split(/[\[\]]/,$str); 
    print Dumper \@arr;'