Help for this page

Select Code to Download


  1. or download this
    $line = '.abc(abc),';
    
  2. or download this
    chop $line;
    
  3. or download this
    $line =~ s/.$//;  #remove the last character before the newline
    $line =~ s/[A-Za-z]$//;  #remove an alphabetic character before the ne
    +wline
    $line =~ s/;$//;  #remove a semicolon at the end of the line
    $line =~ s/[ ]$//; #remove a single space at the end of the line
    $line =~ s/\s+$//;  #remove one or more whitespace characters at the e
    +nd of the line