I have string like
var result = 'Zika NAA, Blood|Zika NAA, Urine'
My requirement is
var result = Zika NAA, Blood
Zika NAA, Urine
|
symbol shouldn't be there and Zika NAA, Urine should come in new line. How to achieve in react js ?
This should work.
var str = "Zika NAA, Blood|Zika NAA, Urine"; var res = str.split("|").join("\\n"); console.log(res)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.