Custom code inspection pattern searching strings
Hi,
I'm new to the feature, but I'd like to define a pattern, that searches string comparisons with == operator. I want to suggest, that they get replaced by an EqualsIgnoreCase().
It would be great if something like this :
if (a.Text == b.Text)
would be found as also
var a = list.Where(l=>l.Text == "test")
Is this possible? I haven't found any solution.
Greets
Please sign in to leave a comment.
This structured pattern works for me. Inside lambda expressions as well.
Attachment(s):
pattern.xml
Thanks! It works. I'm still not sure what I made wrong. Maybe I used something like %str% == %str% .. my fault.
Greets