Given two strings, an input and a mask, remove all characters from the input string present in mask.
Depending on your language, you may be able to filter the string in-place easily.
First create an array of size 256 (assume ASCII character set) with a value of 1 for each character that is present in the mask string. The next few step depend on which language you are coding with, we'll assume C. Keep two variables that keep track of index in input string - one for the position till which string has been filtered, and another for current position. The method described below filters the string in-place.

Iterate through the input string copying each character that is not flagged from our mask array to the next position that hasn't been filtered. After scanning through the whole string add a '\0' to the string after the filtered position to end the string. This will remove the remaining characters in the string assuming some characters were removed from the original due to the mask.

Thoughts or alternate solution? Let us know in the comments below!