I am having some dynamic JSON strings like below:
Status is unknownnThe combination is excluded by the following restrictionnRestriction number 2. 01 Mar 12 08:03:01 0--Exclusion--OrderDeliveryTimeframe.equals(oneMonth) && OrderShipping.equals(air)nn
So when I am printing the same as output, n
is not rendering the text in new line. So I wrote the below code:
return <div>
{item.intro.replace(/[n nn]/g, n)}
<br/>
Now the problem is - It is rendering the text in next line after encountering first occurrence ofn
, but not after that. Neither it is working for nn
. I think I am missing something. Can someone please help me with this. Thanks in advance.