Create a bitmap (bool array).
Traverse string s2, toggling each bit corresponding to a character.
Traverse string s1, skipping the character if the corresponding bit is true.
Obviously modify the length if you want to allow more characters (the example below requires a ToLower()/ToUpper() as it uses 26).
A rough C# Proof of Concept Example (ready to paste in LINQPad):
void Main()
{
// Mapping the alpha lower case characters to start at zero
int magicAsciiAdjust = -96;
string s1 = "asdaswerwe"; // Assumes no non-alpha
string s2 = "asdacbBe"; // Assumes no non-alpha
string output = String.Empty;
bool[] mask = new bool[26];
foreach (char c in s2.ToLower())
{
mask[((int)c) + magicAsciiAdjust] = true;
}
foreach(char c in s1.ToLower())
{
if (!mask[((int)c) + magicAsciiAdjust])
output += c;
}
output.Dump();
}
You could support ASCII by making your mask 128 long. (and removing the ToLower() calls) etc.