好的,这里有一些简单的要点。 PyBinding带有以下脚本:
def IsNotNull(value):
return value is not None
已经很近了,但是我想要的是这个。
bool IsNotNullOrEmpty(string value) {
return (value != null) && (value.Length > 0 );
}
最佳答案
要检查字符串是否为空,可以使用 len
。试试这个:
def IsNotNull(value):
return value is not None and len(value) > 0
关于ironpython - 字符串为空或空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2129713/