vendredi 27 février 2015

string.contains item from combobox

Another complex one, I have searched everywhere and have only been able to find answers to 'how do i find a string in a combo box'


I want to know the opposite. I have a combo box filled with cities (strings) and I am passed an address string.


I would like to search my address string to see if it contains any one of the cities currently in my combo box.


eg. Combo box contains: London, Paris, Berlin


Addresses passed in:



  • 123, street, town, London, Postcode (True)

  • 123, street, town, Rome, Postcode (False)


I was thinking along the lines of



address.Contains(combobox.Any().ToString());


but as you can probably tell, that doesnt work!


Aucun commentaire:

Enregistrer un commentaire