Question: Can you give me a hand please.

I need to do a check, to check if the userCode matches any code in my string array or if the oldUser code also matches any code from the array

```
String[] code = {"1111", "2222", "3333", "4444", "5555"};

String userCode;
String oldUser;

if (userCode.equals(code) || oldUser.equals(code)) {

RUN 

} else { die }

```

thanks

Answer: 
To achieve a simple verification you can loop through your array 
OR
Easy way to do it

```
List< String > code = Arrays.asList( new String[] { "1111", "2222", "3333", "4444", "5555" } );

String userCode;
String oldUser;

if (code.contains(userCode) || code.contains(oldUser)) {

 //doStuff() 

} else { 
    return; 
}

```
Loop the array and check each entry with your user values

```
 String[] code = {"1111", "2222", "3333", "4444", "5555"};

 for (int i = 0; i < code.length; i++) {
     if (userCode.equals(code[i]) || oldUser.equals(code[i])) {
          //do
     }
 }

```

Or using `Arrays.asList()`,

```
List<String> codes = Arrays.asList("1111", "2222", "3333", "4444", "5555");

if (codes.contains(userCode) || codes.contains(oldUser)) {
          //do
}

```