/
52.html152254.html152255.html152256.html152257.html
8172396.html8177822.html8180348.html
认证0级讲师
function delAmpty(str) {
return str.replace(/\s/g,'');
}
alert(delAmpty('hello world'));
This roughly means s matches the whitespace character, and replace is ok. Try it yourself
Be sure to add /g when replacing everything!
My guess is to replace two newlines with one newline, also taking into account whether the blank lines contain spaces.
The above string is equivalent to:
a = '\\n\n52.html\n152254.html\n152255.html\n152256.html\n152257.html\n\n8172396.html\n8177822.html\n8180348.html';
I don’t know python, it’s implemented in JavaScript:
str.replace(/\n\s*\n/g,'\n');
function delAmpty(str) {
}
alert(delAmpty('hello world'));
This roughly means s matches the whitespace character, and replace is ok. Try it yourself
Be sure to add /g when replacing everything!
My guess is to replace two newlines with one newline, also taking into account whether the blank lines contain spaces.
The above string is equivalent to:
I don’t know python, it’s implemented in JavaScript: