ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Use 'String.IsNullOrEmpty'

Last modified: 11 February 2024

Consider the following code snippet:

The above is quite common, and because of this, the String class has the IsNullOrEmpty() method that does the same check as above. Consequently, ReSharper will offer to change your code to use it.