I have two strings:
String fullString = "1234567";
String toRemove = "635";
I’m trying to figure out an easy and compact way to return the characters that don’t appear in both strings. Can do it with two for loops, but it would be nice to avoid that. In this case, it would be “1247”. Any ideas?
You can do this:
It would be somewhat more complex if the second string allowed
^: you would need to check for it, and move it to the back of the string if it is present before enclosing your character set in square brackets.