Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

String manipulation in javascript

I gave a poor description in my prev. question on what i want to do,

so here's another shot:

i have this string:

"<HTML>\n"+
"<P><BODY>\n"+
"<%for(var i=0;i<5;i++){%>\n"+
"<%response.body+=i;%><br/><br/>\n"+
"<%}%>\n"+
"<table border=’1’ width="100%">\n"+
"</BODY></P>\n"+
"</HTML>\n";

and i want to manipulate this into the following:

"response.body+=<HTML>;\n"+
"response.body+=<P><BODY>;\n"+
"for(var i=0;i<5;i++){\n"+
"response.body+=i;response.body+=<br/><br/>;\n"+
"response.body+=</BODY></P>;\n"+
"response.body+=</HTML>;\n";

meaning; adding to anything not in "<% some code %>"

this: "response.body+=" and ";".

how can it be done?

Answer*

Draft saved
Draft discarded
Cancel
0

default

AltStyle によって変換されたページ (->オリジナル) /