Line break inside string (React Native)

I’m developing an app where at some point app receives a string from Facebook Graph API.

String looks like that:

"Some text some text, some text.\n\nMore text and more\n\nAnd little bit more".

How can I replace \n\n with line break what actually works in code?

I know how to replace this with something:

var ret = stringToReplace.replace('\n\n','<br />');

But how can i replace it with working line break. I have tried to replace with ‘\n’ ‘\r\n’. Every replacement just acts like usual text. For example:

"Some text some text, some text.<br />More text and more<br />And little bit more"

90 thoughts on “Line break inside string (React Native)”