I have a c# program which is injecting strings into some javascript, the problem is that in those string there are special characters which are breaking the js and end into "illegal token".
I can't identify what special character is use. Is there a way to filter everything ?
I've tried things like that without success:
retval = new string(input.Where(c => !char.IsControl(c)).ToArray());
retval = retval.Replace("\u200B", "");
Any idea or hint is very welcomed