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";
目前分類:Javascript (1)
- Dec 28 Sun 2008 15:25
[javascript] assign a variable with multi lines