javascript - Split a multiple JS string by new line -
javascript - Split a multiple JS string by new line -
i have next multi-line string has been escaped new-lines:
var types = "a\ b\ c\ d";
i'm trying split them new-lines:
var info = types.split('\n');
i've had no luck this.. how do this?
try splitting regex:
types.split(/ */)
live demo
javascript
Comments
Post a Comment