Binary strings: Difference between revisions

m
→‎{{header|Perl 6}}: Update to modern syntax.
m (→‎{{header|Perl 6}}: Update to modern syntax.)
Line 2,157:
 
=={{header|Perl 6}}==
{{Works with|rakudo|20162018.1203}}
<lang perl6># Perl 6 is perfectly fine with NUL *characters* in strings:
my Str $s = 'nema' ~ 0.chr ~ 'problema!';
Line 2,201:
 
# A couple of operators for our new type:
multi infix:<cmp>(ByteStr $x, ByteStr $y) { $x.bytes.join cmp $y.bytes.join }
multi infix:<~> (ByteStr $x, ByteStr $y) { ByteStr.new(:bytes(|$x.bytes, |$y.bytes)) }
 
10,339

edits