i have string[] _comboBoxItems which has 271 elements like
a1 03154643
a1 03450324
a2 08432155
a1 13549812
now i want to search in this array. If i write 03 i want to get
a1 03154643
a1 03450324
how can i ignore a1 (first tree letters). I want to use comboBoxItems .startswith() but i don’t know how to remove a1 when searching
You need to first select the substring that starts from the fourth character of each item:
The query uses
OfTypeto make sure that you are only going to process strings and to cast them appropriately.Update: If there are going to be strings with length < 3 characters inside the combo box (which from your description does sound unlikely), then you should also check for that eventuality: