Documentation for routine chop

Documentation for routine chop, assembled from the following types:

class Cool

From Cool

(Cool) routine chop

Defined as:

sub chop(Str(Cool))
method chop()

Coerces the invocant (or in sub form, its argument) to Str, and returns it with the last character removed.

say 'perl'.chop;                        # OUTPUT: «per␤» 

class Str

From Str

(Str) routine chop

multi sub    chop(Str:D --> Str:D)
multi method chop(Str:D: $chars = 1 --> Str:D)

Returns the string with $chars characters removed from the end.