phi

I'm a Game Programmer and Frontend Engineer passionate about programming education. Math / C / C++ / C# / JavaScript / HTML5 / CSS3 / Python

phiaryjust a creator

JavaScript tips - 改行コードを取り除く

4 years ago

Demo

Code

var a = 'aaa\nbbb\nccc';  
var b = a.replace(/[\r\n]/g, '');