您的位置 首页 java

Java里如何判断一个String是空字符串或空格组成的字符串

public class TestEmpty

{

public static void main(String[] args){

String a = ” “;

// if (a.isEmpty())

if (a. trim ().isEmpty())

{

System.out.println(“It is empty”);

}

else

{

System.out.println(“It is not empty”);

}

}

}

文章来源:智云一二三科技

文章标题:Java里如何判断一个String是空字符串或空格组成的字符串

文章地址:https://www.zhihuclub.com/170873.shtml

关于作者: 智云科技

热门文章

网站地图