Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, I'm trying to check for an empty string, but a string with just spaces is coming back as "not empty", is there a way to check for any spaces and also return empty? Here's what isn't working:
@combinedPropsHuman != String.Empty
Hi Amir,
How about !string.IsNullOrWhiteSpace(combinedPropsHuman)
!string.IsNullOrWhiteSpace(combinedPropsHuman)
Jeavon
That'll do it, thanks Jeavon!
Awesome!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Razor if statment with empty string
Hi, I'm trying to check for an empty string, but a string with just spaces is coming back as "not empty", is there a way to check for any spaces and also return empty? Here's what isn't working:
Hi Amir,
How about
!string.IsNullOrWhiteSpace(combinedPropsHuman)
Jeavon
That'll do it, thanks Jeavon!
Awesome!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.