One step check for null value & emptiness of a string

前端 未结 7 1087
一向
一向 2020-12-18 23:51

I have a setter method.

Then when another (say generate) method is run, I need to check the value of my fields. So in the case of String property, I need to know if

相关标签:
7条回答
  • 2020-12-19 00:54

    If you are doing android development, you can use:

    TextUtils.isEmpty (CharSequence str) 
    

    Added in API level 1 Returns true if the string is null or 0-length.

    0 讨论(0)
提交回复
热议问题