I have a string replace problem. I have a result like:
"Animal.Active = 1 And Animal.Gender = 2"
I want to replace something in this text.
Animal.Active part is returned from a database and sometimes it is returned with the Animal.Gender part.
When Animal.Gender part comes from the database I have to remove this And Animal.Gender part.
Also if the string has Animal.Active = 1, I have to remove Animal.Active = 1 And part. Note the And.
How can I do this?
You will need to use a regular expression (regex) to replace this, then, since you want to match a number.
Will work to replace
"And Animal.Gender = #"with zero or more white spaces between the=sign.You can do a similar replacement for the second request, with Animal.Active.