If your string (In your case the variable text
) could be null this would make a big Difference:
1-string.IsNullOrEmpty(text.Trim())
--> EXCEPTION since your calling a mthode of a null object
2-string.IsNullOrWhiteSpace(text)
This would work fine since the null issue is beeing checked internally
To provide the same behaviour using the 1st Option you would have to check somehow if its not null first then use the trim() method
if ((text != null) && string.IsNullOrEmpty(text.Trim())) { ... }