Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
行末清掃(「スクリプト実行」用スクリプト)
/*
* 行末清掃
* (行末の余計な空白やタブを削除する)
*
* 「スクリプト実行」用スクリプト
* http://books.ivory.ne.jp/execscript/
*/
var lines = data.split("\n");
var outdata = new Array();
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
line = line.replace(/\s+$/, '');
outdata.push(line);
}
return outdata.join("\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment