How to exclude a few words from a string field returned from an api response in ReactJS

im trying to exclude a few words from an api string that was returned. I did research on this and saw that people were using REGEX(regular expressions) for this. I tried to copy what they did, however, with api responses, it adds another level of difficulty to it and is not quite the same.

enter image description here

Is there a way to exclude the "Messari Daily Brief" from the api and include everything else? Im trying to grab everything from that title field but the Messari Daily Text.

I tried store the string like this

const title = this.props.newsItems.title;

Then I tried to do the regex:

const extractedString = '/Messari Daily Brief /'

Thanks for taking the time to read this!

2 thoughts on “How to exclude a few words from a string field returned from an api response in ReactJS”

Leave a Comment