Help for this page

Select Code to Download


  1. or download this
    $string =~ s/-L|L-/-/g;
    $string =~ s/^L//;
    $string =~ s/L$//;
    
  2. or download this
    $string =~ s/^L|(?<-)L|L(?=-)|L$//g;
    
  3. or download this
    # Does a bit more than stripping, but in an inconsequential fashion.
    $string =~ s/^L|-L|L-|L$/-/g;