You want to replace with?????
Suppose, you have illegal character at index 6.
And you want to replace it with say 000.

IllegalCharacters[6]=000;

Is this, what you was trying to ask??? May be...