Please help me manipulate the following string, I am really stuck.
str= ~valveopen leak okh2 leak valveopen okh1;
in this string I want to delete those substrings that have a pair. Forexample
~valveopen and valveopen is a pair
leak and ~leak is a pair
and i want to retain those substrings that donot have pairs.so after making changes the string should be like this
I would really appreciate any kind of help.