I’m using react native to create a category table.
Is there any way I can make the characters(texts) inside the table to line break at after or before a specific character?
for example : apple/banana/avocado
I want it to render like this (line break at after ‘slashes’) :
apple/banana/</ br>avocado
Thanks,
3
Answers
Yes, it is possible. Like in a normal react application you can use the following javascript functions:
You could take match instead of split by taking some non breaking character, a breaking character and other non breking character.
After breaking the names into an array you can simply map them in react native
Expanding on my comment demo: