develooper Front page | perl.perl6.users | Postings from February 2020

Substr behaviour with CRLF

Thread Next
From:
David Santiago
Date:
February 10, 2020 15:58
Subject:
Substr behaviour with CRLF
Message ID:
29347DCA-C07C-4053-844F-8356BE96A320@gmail.com


Hi!

Is there a way to change the the following behaviour, so it considers \r\n as two characters when using substr, instead of one?

On raku version 2019.11

> "1234\r\n". substr(*-4)
4
78
> "1234\r\n". substr(*-4).ords()
(52 13 10 55 56)


Best regards,
David Santiago

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About