How to check null on StringBuilder?

前端 未结 6 2245
自闭症患者
自闭症患者 2021-02-18 18:39

I want to check for null or empty specifically in my code. Does empty and null are same for StringBuilder in Java?

For example:

StringBuilde         


        
6条回答
  •  一个人的身影
    2021-02-18 19:37

    You can try like this

    StringBuilder state = new StringBuilder();
    if(StringUtils.isNotBlank(state .toString())){   
    //this will check for null, " ", ""
    }
    

提交回复
热议问题