One step check for null value & emptiness of a string

前端 未结 7 1136
一向
一向 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.

提交回复
热议问题