Error prompted unterminated string literal, mainly because the output in JS contains N. The solution is to first take the data in the following way to remove N, and then pass the value of JS.
The code is as follows |
Copy Code |
public static string Myreplace (String mystr) { MyStr = mystr. Replace ("Nr", "<br> "); /Note The order of the/r/n here, this is the wrong writing or error MyStr = mystr. Replace ("RN", "<br/> "); /This is the right thing! MyStr = mystr. Replace ("T", " "); MyStr = mystr. Replace ("", " "); MyStr = mystr. Replace ("<", "<"); MyStr = mystr. Replace (">", ">"); MyStr = mystr. Replace ("&", "&"); return mystr; } |
Replace line wrapping in asp:
1 Str=replace (Str,vbcrlf, "", 1,-1,1)
Replace line wrap in PHP:
The code is as follows |
Copy Code |
1 $str = Str_replace ("n", "", $str); 2 $str = Str_replace ("R", "", $str); |
The document.write (str) output is then performed.
If it is a single double quotation mark, we can replace or directly escape the
code is as follows |
copy code |
s= S.replace ("" "," \ "+" ");// |