How to escape line break already present in a string?
问题 I have a question, why does this: testStr="\n" testStr = "\\"+testStr print testStr >>> \ happen? Shouldn't it now print \n ? I know about the repr() function, but I would rather solve this in another way It would be very kind if you could help me 回答1: After you type testStr = "\n" the special characters are already being interpreted. So in the next line you cannot change their interpretation as it already has happened. This is being done during lexical analysis stage, so even way before the