How to Split a Byte String into Lines?
Problem Formulation: Given a byte string that contains new-line characters ‘\n’. How to split the byte string into a list of lines? Example: You want to transform the byte string b’your\nbyte\nstring’ into the list of byte strings [b’your’, b’byte’, b’string’] using b’\n’ as a newline separator. Given: b’your\nbyte\nstring’ Goal: [b’your’, b’byte’, b’string’] Solution: To split … Read more