Documentation for routine chop
assembled from the following pages:
Class: Allomorph §
From Allomorph
(Allomorph) method chop §
method chop(Allomorph: |c)
Calls Str.chop
on the invocant's Str
value.
Class: Str §
From Str
(Str) routine chop §
multi method chop(Str:)multi method chop(Str: Int() )
Returns the string with $chopping
characters removed from the end.
say "Whateverable".chop(3.6); # OUTPUT: «Whatevera» my = "Whateverable";say .chop("3"); # OUTPUT: «Whatevera»
The $chopping
positional is converted to Int
before being applied to the string.
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 'raku'.chop; # OUTPUT: «rak»