Within Node, how do I split a string using newline ('
') ?
I have a simple string like var a = "test.js
again.js"
and I need to get ["test.js", "again.js"]
.
I tried
a.split("
");
a.split("\n");
a.split("
");
a.split("
");
but the above doesn't work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…