string strReturn = ""; string strCompanyLookup = ""; string strCompanyField = "(!Department!)"; strCompanyField = strCompanyField.ToLower(); string srCrlf= @"(!crlf!)"; string strFormat = "(!format!)"; string[] keys = new string[] { "international-distribution", "it"}; for (int x = 0; x < keys.Length; x++) { if(strCompanyField.Contains(keys[x])){ strCompanyLookup = keys[x]; } } // ... Switch on the string. switch (strCompanyLookup) { case "international-distribution": { if(strFormat=="1"){ strReturn = "dist.PNG"; } else{ strReturn = "\r\nInternational Distribution" ; } break; } case "it": { if(strFormat=="1"){ strReturn = "IT.PNG"; } else{ strReturn = "\r\nInformation Technology" ; } break; } default: { System.Console.WriteLine("Other Address"); break; } } return strReturn;