M
M
memsartem2021-12-19 13:17:49
Python
memsartem, 2021-12-19 13:17:49

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

1 answer(s)
H
HemulGM, 2021-12-19
@HemulGM

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 question

Ask a Question

731 491 924 answers to any question