Question: What is the best practice way to use two clauses in LINQ Contains method..

Title is string

**This is my If statement :** 

```
if (oWeb.ParentWeb.Title.Contains("Ricky") || oWeb.ParentWeb.Title.Contains("John"))

```

**I need solution like this :**

```
 if (oWeb.ParentWeb.Title.Contains("Ricky", "John"))

```

Answer: 
I don't think LINQ is the best option for that. Why not use regular expressions?

```
Regex.IsMatch(oWeb.ParentWeb.Title, "ricky|john", RegexOptions.IgnoreCase);

```
`Contains` takes only one parameter, so you cannot do it this way.

You can make an array of items, and check containment with it:

```
var titles = new[] {"Ricky", "John"};
if (titles.Any(t => oWeb.ParentWeb.Title.Contains(t))) {
    ...
}

```