Question: In c# how can I check in the file name has the "pound sign" and "apostrophe sign" 
This is waht I tried so far but doesn't work. 
I need to send an error if the # or ' are in the filename

return filename.Contains("#\'");

Answer: 
You can use [IndexOfAny](http://msdn.microsoft.com/en-us/library/11w09h50.aspx):

```
if (filename.IndexOfAny(new char[] {'#', '\''}) > -1)
{
    // filename contains # or '
}

```
Try something like this:

```
Regex.IsMatch(fileName, @"[#']");

```