Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IsNullOrWhiteSpace extension method in .Net 4?

Tags:

.net

Is there an extension method for IsNullOrWhiteSpace defined in .Net 4?

I have used this extension method before, but I can't find it, and I'm starting to wonder if I was using a custom extension at the time without realizing it.

like image 449
Joseph Gabriel Avatar asked Oct 23 '25 08:10

Joseph Gabriel


1 Answers

You probably had a reference to WebGrease.dll. In the Microsoft.Ajax.Utilities namespace, there is an IsNullOrWhiteSpace() extension method on string.

using Microsoft.Ajax.Utilities;

"".IsNullOrWhiteSpace(); //This compiles
like image 125
gerg Avatar answered Oct 25 '25 21:10

gerg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!