I have string that I'm trying to manipulate, for example, "Hello World"
I want to be able to check if the string contains the word "World" and if it does, wrap it in a <span>
, so the end result would be:
"Hello <span>World</span>"
What would be the cleanest way to do this?