In the top of form1
textBox1.Text = "TextToSearch{}";
First I want to force the user to be able to type only inside the TextToSearch{}
between the two { }
and if there are more then one:
TextToSearch{},TextToSearch{}
then the user will be able to type only in between the two { }
in both places. In the rest of the TextBox
area he will not be able to type.
I want to use later this TextToSearch{}
as separator between multiple texts searching. For example:
TextToSearch{hello}
It will search for the word hello
And:
TextToSearch{hello},TextToSearch{hi}
Now it should search for hello
and hi
not hellohi
but separate hello
and hi
.
So I also need to parse this texts to string array
.
Before I used just ,
to separate.
string[] values = textBox1.Text.Split(',');
hello,hi
It was easy.
But now the texts are in TextToSearch{}
between the { }
and also separate this by ,
for example:
TextToSearch{hello},TextToSearch{hi}
So I need to take out the hello
and hi
and put them in the values array
.