I am doing a filter on my DataGridView and I want that the user can search in all Columns through only one TextBox.
I want this behavior:
Name | Address | Telephone
Luis | Costa Rego | 36595845
Paulo | Antonio Emmerich | 36595846
The user search: 3659584
and it shows:
Name | Address | Telephone
Luis | Costa Rego | 36595845
Paulo | Antonio Emmerich | 36595846
but when he search: 3659584 Lu
it shows:
Name | Address | Telephone
Luis | Costa Rego | 36595845
To do so, I need to substring all the user inputs through the spaces
between each word, but I do not know the best approach to achieve that. I know how to do substring with spaces, but I do not know hot to get the amount of words to initialize the array neither how to create the loop to get all words.
Being like:
String search = "Luis Costa"
;
String[] words;
words[0] = "Luis"
words[1] = "Costa"