Balanced brackets: Difference between revisions

Line 3,394:
===String munging===
Of course, a Perl 5 programmer might just remove as many inner balanced pairs as possible and then see what's left.
{{works with|Rakudo|2015.12}}
<lang perl6>sub balanced($_ is copy) {
()Nil while s:g/'[]'//;
$_ eq '';
}
Anonymous user