相关疑难解决方法(0)

检查字符串是否为空且不为空

如何检查字符串是否为空且不为空?

public void doStuff(String str)
{
    if (str != null && str != "**here I want to check the 'str' is empty or not**")
    {
        /* handle empty string */
    }
    /* ... */
}
Run Code Online (Sandbox Code Playgroud)

java string string-comparison

466
推荐指数
15
解决办法
86万
查看次数

标签 统计

java ×1

string ×1

string-comparison ×1