---
title: "check for any item in string array?"  
description: "check for any item in string array?"  
author: "David Miller"  
published: 2014-12-21  
updated: 2014-12-22  
canonical: https://www.mindstick.com/forum/12803/check-for-any-item-in-string-array  
category: "asp.net"  
tags: ["c#", "array"]  
reading_time: 1 minute  

---

# check for any item in string array?

```
static void Main(string[] args){     if (args[0].ToUpper().Equals("DOWNLOADPOS"))    {        DownloadPOS();    }
```

will run DownloadPOS(), if the first [item](https://www.mindstick.com/forum/156564/remove-item-in-an-array-in-javascript) in args is downloadpos, I would like to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) [against](https://yourviews.mindstick.com/view/81332/the-approach-of-science-against-disease-epidemics) all the [items](https://www.mindstick.com/forum/33812/getting-number-of-items-selected-in-uicollectionview-in-ios) in args?? please advise?

I was previously using:

//if (args.Contains([pos](https://answers.mindstick.com/qa/105131/what-are-the-advantages-of-mobile-pos-systems-for-businesses)))

//{

// DownloadPOS();

//}

but then wasnt sure how to sure the upper on it

thanks

## Replies

### Reply by Anonymous User

You can use Linq, Enumerable.Any Method Method

```
var exist = args.Any(x =>x.ToUpper().Equals("DOWNLOADPOS"));if (exist){    DownloadPOS();}
```

### Reply by Anonymous User

```
if (arg.Any(x => x.Equals("DOWNLOADPOS",StringComparison.OrdinalIgnoreCase))){    DownloadPos();}
```

If you need to support special cultures (e.g. Turkish), use StringComparison.InvariantCultureIgnoreCase instead of StringComparison.OrdinalIgnoreCase


---

Original Source: https://www.mindstick.com/forum/12803/check-for-any-item-in-string-array

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
