Code style Tip: Case insensitive string comparison
- by Michael Freidgeim
Goodif (String.Compare(myString, ALL_TEXT, StringComparison.OrdinalIgnoreCase) == 0) { return true; }OK(not obvious what true means) if (String.Compare(myString, ALL_TEXT, true) == 0) { return true; }BAD: (non null safe) if (myString.ToLower()==ALL_TEXT.ToLower() { return true; }