What is the difference between \r\n, \r, and \n? [duplicate]

What is difference in a string between \r\n, \r and \n? How is a string affected by each?

I have to replace the occurrences of \r\n and \r with \n, but I cannot get how are they different in a string…

I know that \r is like hitting enter and \n is for a new line.

Leave a Comment