How to make an array from a string by newline in JavaScript?
Use JavaScript .split()
function to create an array with elements split by '\n'and then manually iterate through that array and add '<' for each item. The following code may help :
var str="How\nare\nyou\ndoing\ntoday?";var n = str.split("\n");for(var x in n){ n[x]= '>'+n[x]; alert(n[x]);}