Ok, here are some easy points. PyBinding came with this script:
def IsNotNull(value):
return value is not None
It is close, but what I want is this.
bool IsNotNullOrEmpty(string value) {
return (value != null) && (value.Length > 0 );
}
To check if a string is empty you would use len
. Try this:
def IsNotNull(value):
return value is not None and len(value) > 0
You should not be doing this in a function. Instead you should just use:
if someStringOrNone:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With