Difference between \r and \n

前端 未结 5 577
粉色の甜心
粉色の甜心 2020-12-02 23:09

What is the difference between \\r and \\n in a regular expression?

Can someone explain it with an example?

5条回答
  •  死守一世寂寞
    2020-12-03 00:01

    \n is linefeed

    \r is carriage return

    In windows, for example, line endings are \r\n. In the vast majority of other operating systems, they are \n.

提交回复
热议问题