Reputation: 21
>>> output = "10.1.1.2\11.1.1.2$11.1.1.2\10.1.1.2"
>>> output.split("$")
['10.1.1.2\t.1.1.2', '11.1.1.2\x08.1.1.2']
Upvotes: 2
Views: 270
Reputation: 240030
Split isn't adding anything, you are. \11
is character octal 11 (decimal 9), which is tab. \10
is character octal 10 (decimal 8), which is usually written \x08
. They're already in output
before the split
.
If you want backslashes in your string, write them as \\
, or use a raw string, r"10.1.1.2\11.1.1.2$11.1.1.2\10.1.1.2"
.
Upvotes: 5