http://www.codehouse.com/javascript/tips/string_multiline/
http://www.regular-expressions.info/reference.html

Use Notepad++ to replace "\r" to "\\n\\\r" of desired contents by "Extended" model in Find Replace dialog.
Eg.

Assign

A(CR)(LF)
B(CR)(LF)
C(CR)(LF)
D

to variable XYZ.

First, replace "\r" to "\\n\\\r"

A\n\(CR)(LF)
B\n\(CR)(LF)
C\n\(CR)(LF)
D

In addition, put above result into XYZ; for instance,

var XYZ = "A\n\(CR)(LF)
B\n\(CR)(LF)
C\n\(CR)(LF)
D";
創作者介紹
創作者 wenching520 的頭像
wenching520

牧羊人

wenching520 發表在 痞客邦 留言(0) 人氣()