hi
if my search string contains multiple and,multiple or
we are replacing and,or with space.
for example:- search string like "andandandandjavaandandand".
we are removing all and.(then search string is "java".
OR
and and and and and and java or or or orororor.here also replacing all and,or with space.
upto this it is working fine.
But the problem is if my search word is like "android"
then i don't want to remove "and"
if like "configurator".in this i don't want to remove or.because it is a meaningful word.i want to search on that word.
this is my code
if (TextBox1.Text.EndsWith("and"))
{
TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.Text.Length - 3);
TextBox1.Text.Trim();
}
if (TextBox1.Text.EndsWith("or"))
{
TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.Text.Length - 2);
TextBox1.Text.TrimEnd();
}
if (TextBox1.Text.StartsWith("and"))
{
TextBox1.Text = TextBox1.Text.Remove(0, 3);
}
if (TextBox1.Text.StartsWith("or"))
{
TextBox1.Text = TextBox1.Text.Remove(0, 2);
}
how can i write code for this