How can I split a line in Python at a non-printing ascii character (such as the long minus sign hex 0x97 , Octal 227)?
I won’t need the character itself. The information after it will be saved as a variable.
How can I split a line in Python at a non-printing ascii character (such
Share
You can use
re.split.Adjust the pattern to only include the characters you want to keep.
See also: stripping-non-printable-characters-from-a-string-in-python
Example (w/ the long minus):
Or, the same with unicode: