I am new to python and wanted to find the equivalent of C# string.IsNullOrWhiteSpace in python. With my limited web search, I created the below function
def isNullOrWhiteSpace(str):
return not str or not str.strip()
print "Result: " + isNullOrWhiteSpace("Test")
print "Result: " + isNullOrWhiteSpace(" ")
#print "Result: " + isNullOrWhiteSpace() #getting TypeError: Cannot read property 'mp$length' of undefined
But this is printing
Result: undefined
Result: undefined
I wanted to try how it would behave if no value is passed. Unfortunately, I am getting TypeError: Cannot read property 'mp$length' of undefined for the commented line. Can someone help with these situations I need to handle?