Answer the question
In order to leave comments, you need to log in
How to replace newline with /n?
I'm using PyQT5. It is necessary to replace all transitions to a new line in the text from textEdit with \n. How can this be implemented?
Answer the question
In order to leave comments, you need to log in
Line feed is also a character. So look for the newline character and replace it with \n
The standards are as follows:
in Windows, a newline is CR + LF (#13#10)
in a line - LF (#10)
in a poppy - CR (#13)
I.e. look for substrings #13#10 and #13 and #10 and replace with string '\n'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question