Question: I am currently creating an application that will read an NFC tag and look up the text of the tag against a string array to see if it is there. It works if the tag is case sensitive correct e.g. 'Test', not 'test'. I have tried various methods which haven't worked. Would someone please look at my code and see which is the best solution for me.

Here is the relevant code:

```
String[] dd;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    dd = getResources().getStringArray(R.array.device_description);

}

@Override
    protected void onPostExecute(String result) {
        if (result != null) {
            if(Arrays.asList(dd).contains(result)) {
            Vibrator v = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
            v.vibrate(800);
            //mText.setText("Read content: " + result);
            Intent newIntent = new Intent(getApplicationContext(), TabsTest.class);
            Bundle bundle1 = new Bundle();
            bundle1.putString("key", result);
            newIntent.putExtras(bundle1);
            startActivity(newIntent);
            Toast.makeText(getApplicationContext(), "NFC tag written successfully!", Toast.LENGTH_SHORT).show();
            }
            else{
                Toast.makeText(getApplicationContext(), result + " is not in the device description!", Toast.LENGTH_SHORT).show();
            }
        }
    }

```

Answer: 
Simple array search can do it:

```
public static boolean doesArrayContain(String[] array, String text) {
    for (String element : array)
        if(element != null && element.equalsIgnoreCase(text)) {
             return true;
        }
    }
    return false;
}

```

And you can call it like this:

```
doesContain(dd, result);

```
The solution could be found if you don't do something case-insensitive, try to upper the first letter of any word before looking for it in the array.