I have been trying to do a very simple task but seems pretty hard. I am trying to split a string at the backslash ('\'
). I have found few similar posts to this topic but no one was actually addressing a comprehensive issue.
This is the string I want to chop up:
'13
Bono
Goalkeeper
Apr 5, 1991 (29)
€15.00m '
The problem is if I use .split('\')
with the string above I get a syntax error:
SyntaxError: EOL while scanning string literal
I have also tried:
- Double backslash
\
- Triple quotes
"""\"""
But it doesn't work either.
I know I can add r
in front of a string but would not be suitable as the string is part of a huge list and would have to add to each string the r
in front of it.
In conclusion, is there a simple way to simply chop up words using the backslash as the delimiter?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…