Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Str.chop accepts count of number of chars to chop
  • Loading branch information
lizmat committed May 15, 2014
1 parent ea173d0 commit 831b1d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Str.pm
Expand Up @@ -77,9 +77,9 @@ my class Str does Stringy { # declared in BOOTSTRAP
nqp::p6box_s(nqp::substr($sself, 0, $chars - $to_remove))
}

method chop(Str:D:) {
method chop(Str:D: $chars = 1) {
my str $sself = nqp::unbox_s(self);
nqp::p6box_s(nqp::substr($sself, 0, nqp::chars($sself) - 1))
nqp::p6box_s(nqp::substr($sself, 0, nqp::chars($sself) - $chars))
}

method substr(Str:D: $start, $length? is copy) {
Expand Down

0 comments on commit 831b1d4

Please sign in to comment.