Is there a way to do string - string?

Hey guys!
I have 2 strings in the msg. (first string msg.hello, second msg.cookie)
The problem I have is msg.hello contains words that I don't want in msg.hello.
msg.cookie contains the words that I want to delete from msg.hello.
msg.hello = "I love Node Red because";
msg.cookie = "because";

Is there a way to do something like msg.hello - msg.cookie?
msg.hello should look in the end "I love Node Red".

Hope somebody can help me!

This might/should work


I suspect the change node will only work if there is just one word in msg.cookie. You said 'words' in your message which suggests more than one.
Also check what happens if msg.cookie is an empty string (if that can ever happen) or does not exist at all.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.