❔ newbie here. how to check for duplicate string vs a combobox list?
im not too sure how to write this. so from combobox textbox i should be able to write something e.g. category is math then if it's still not on the combobox list, add it. ignorecase Math or math
this is visual studio windows forms app combobox
3 Replies
iterate through each string (with a for loop or a foreach) in your combobox and check if each is equal to the combobox's text
alternatively you can use a LINQ method that helps you do that
eg
assuming all of the items are a type of string in your list
or simply use a foreach
and use that method
ty
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.