I'm passing a String to a method that has commas in as delimiters.

```
"TMJ,Emma,Sarah"

```

I tokenize this String using ',' as the regular expression to split.

I then iterate the length of the tokenized array comparing each element against a HashMap of all possible values. If the value being tested is a key in the HashMap then i get the key's value and store that in another String. 

I want to append each value of the key to the String that holds the values.

It seems to iterate only once, then jumps out of the loop and returns only the first thing it finds in the hashmap.

Could anyone explain why? Thanks in advance Matt.

```
public static String getrecipientIntergerValues(String recipient) {

        Log.e(TAG, "recipient string list passed in to app obj = " + recipient);

         String[] tokenizedRecipient = recipient.split(",");
         String recipientAsInteger = "";

         for(int i = 0; i < tokenizedRecipient.length; i++){
             Log.e(TAG, "tokenizedRecipient = " + tokenizedRecipient[i].toString());
         }

         Log.e(TAG, "tokenizedRecipient length = " + tokenizedRecipient.length);

         for(int i = 0; i < tokenizedRecipient.length; i++){

             if(recipients.containsKey(tokenizedRecipient[i].toString())){
                 Log.e(TAG, "hashmap contains key " + tokenizedRecipient[i].toString() + "with value " + recipients.get(tokenizedRecipient[i].toString()));
                 String integerValueOfName = recipients.get(tokenizedRecipient[i].toString());
                 recipientAsInteger = recipientAsInteger + integerValueOfName + ",";

             }

         }

        Log.e(TAG, "recipient list as integers = " + recipientAsInteger);

        return recipientAsInteger;
    }

```

.

```
09-20 16:33:51.039: E/NfcScannerApplication(25835): recipient string list passed in to app obj = Emma, TMJ, 
09-20 16:33:51.039: E/NfcScannerApplication(25835): tokenizedRecipient = Emma
09-20 16:33:51.064: E/NfcScannerApplication(25835): tokenizedRecipient =  TMJ
09-20 16:33:51.064: E/NfcScannerApplication(25835): tokenizedRecipient =  
09-20 16:33:51.079: E/NfcScannerApplication(25835): tokenizedRecipient length = 3
09-20 16:33:51.079: E/NfcScannerApplication(25835): hashmap contains key Emmawith value 3
09-20 16:33:51.089: E/NfcScannerApplication(25835): recipient list as integers = 3,

```