当前位置: 移动技术网 > IT编程>软件设计>面向对象 > isNotBlank()和isNotEmpty()总结

isNotBlank()和isNotEmpty()总结

2019年12月09日  | 移动技术网IT编程  | 我要评论
import org.apache.commons.lang.stringutils;
import org.junit.test;


public class test{

    //总结:isnotblank()一定要里面有东西 null,""," ",返回的都是false
    @test
    public void testdemo1(){
        string str = " ";
        system.out.println(stringutils.isnotblank(str));//true
    }

    //总结:isnotempty()是将空格也算在里面,null,"",返回的是fasle," "返回的是true
    @test
    public void testdemo2(){
        string str = "";
        system.out.println(stringutils.isnotempty(str));
    }


    
}

org.apache.commons.lang工具包下面的isnotblank()和isnotempty()使用总结

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网