Okey, I need some help with a code in Javascript.
If this is the input of a string: "\nLorem ipsum\nMid magnis\nTristique mauris proin"
I want this as output: "\n\t\t\tLorem ipsum\n\t\t\tMid magnis\n\t\t\tTristique mauris proin"
So I tried to do this function:
var text = function (texts) {
var str = texts;
return str.replace("\n", "\n\t\t\t");
}
------> "\n\t\t\tLorem ipsum\nMid magnis\nTristique mauris proin"
And it takes only the first "\n" and replace it with "\n\t\t\t".
So please, can I have som help? Cheers!