iam having a text string with characters like "__"(two underscores) in the string whenever i encounter the two underscores i want to replace them with a specific view like box and render it so for example:
str = "iam __ and i want to go to __"
so i want to render iam (want to render rectangular box here) and i want to go to (rectangular box here)
i have tried using the split function in js and split them by __ and tried pushing the jsx to array based on condition but it was rendering in different lines is there any better way to do it code i tried:
const stringsArr = str.split('__');
const toRender = []
for(let i=0;i<stringsArr.length;i++){
toRender.push(<Text styles={styles.emptyBlock} />)
toRender.push(<Text>{stringsArr[i]}</Text>)
}