I have a doubt of how do I add a line breaker in a js string . The below is the code :
{
"id": 7,
"last": 1,
"name": "Customer received Email to change the password/Received. And code that customer hasn’t requested"
},
I want a line break after password/Received. I want the desired output as
Customer received Email to change the password/Received.
And code that customer hasn’t requested
If you want to add the line break and cannot modify the origin of the text, then you could do something like this:
str = "Customer received Email to change the password/Received. And code that customer hasn’t requested";
str.replace("password/Received. ","password/Received.\n");
Replace \n with <br/> if you want to output this in HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With