On 2014-01-10 02:04, Jesse Phillips wrote:

Interesting, I've had the opposite experience. I keep trying to perform
range operations and C# doesn't have them. Slicing is of course ever
more desired.

That isn't to say C# is bad, but

     if(string.IsNullOrEmpty(str))

vs

     if(str.empty)

keeps throwing me off.

Or as in Ruby on Rails:

if str.blank?
end

"str" is conisderd blank if:

* it's nil (null)
* empty (its length is 0)
* it only contains whitespce

BTW, it works on all objects, not just strings. For arrays it will check the length as well, but for other objects it will just check for nil.

--
/Jacob Carlborg

Reply via email to