Return symbol

From LemonWiki共筆
Jump to: navigation, search

換行符號 (Return symbol, line terminators, line endings, newline, end of line (EOL), line feed or line break)

  • On Win Os windows.png : CRLF = \r\n
  • On Unix, Linux Os linux.png & recent versions of Mac Os mac.png : LF = \n
  • On classic versions of Mac Os mac.png [1][2] e.g. Mac OS 9: CR = \r

如何看到換行符號[edit]

查看每一行使用的換行符號

  • Notepad++ On Win Os windows.png 選單 → 檢視 → 特殊字元 → 顯示行尾字元 (EOL)

查看檔案使用的換行符號


檔案內容 File command 偵測結果
換行符號是 CRLF = \r\n UTF-8 Unicode text, with CRLF line terminators
換行符號是 LF = \n UTF-8 Unicode text Icon exclaim.gif
換行符號是 CR = \r UTF-8 Unicode text, with CR line terminators
特例: 換行符號夾雜 \r\n\r UTF-8 Unicode text, with CRLF, CR line terminators
特例: 換行符號夾雜 \r\n\n UTF-8 Unicode text, with CRLF, LF line terminators
特例: 換行符號夾雜 \n\r UTF-8 Unicode text, with CR, LF line terminators
特例: 無內容的空檔案 empty

如何取代換行符號[edit]

支援 Regular expression 的文字編輯軟體

MySQL

  • SELECT REPLACE(REPLACE(REPLACE(`column`,'\r\n',''),'\n',''),'\r','') [4]


Related articles[edit]

References