remotepath != null 与 !TextUtils.isEmpty(remotepath) 的区别
2014-10-11 14:16
447 查看
remotepath != null 与 !TextUtils.isEmpty(remotepath) 的区别
!TextUtils.isEmpty(remotepath) 与 remotepath != null &&remotepath.length > 0 一样
或者初始化 remotepath = null,这时只判断 remotepath != null 也可以,如果初始化 remotepath = “” ,这时必须 用!TextUtils.isEmpty(remotepath) 判断
可以单独写个java main 方法检验
public class Test {
private static String str = "";
/**
* @param args
*/
public static void main(String[] args) {
setText();
}
public static void setText(){
if(str != null)
System.err.println("daying");
}
}
!TextUtils.isEmpty(remotepath) 与 remotepath != null &&remotepath.length > 0 一样
或者初始化 remotepath = null,这时只判断 remotepath != null 也可以,如果初始化 remotepath = “” ,这时必须 用!TextUtils.isEmpty(remotepath) 判断
可以单独写个java main 方法检验
public class Test {
private static String str = "";
/**
* @param args
*/
public static void main(String[] args) {
setText();
}
public static void setText(){
if(str != null)
System.err.println("daying");
}
}
相关文章推荐
- remotepath != null 与 !TextUtils.isEmpty(remotepath) 的差别
- "=="& .equals() & TextUtils.isEmpty(str) & str.isEmpty() 之间的区别
- string比较:“==”,equals(),TextUtils.isEmpty(str),str.isEmpty()的区别
- php中empty() isset() is_null() 的区别
- php中empty(), is_null(), isset()函数区别
- PHP中empty、isset和is_null的使用区别
- StringUtils.isEmpty和StringUtils.isBlank的区别
- PHP 变量函数 empty()、is_null()、isset()、(bool) 的区别
- php中is_null,empty,isset,unset 的区别详细介绍
- php 中的 defined isset empty is_null的区别
- 【isNull isEmpty isNotNull isNotEmpty 】在iBatis中区别
- 在ibatis中isNotNull和isNotEmpty的区别
- empty,is_null,isset的区别
- php中empty,is_null,isset三个函数的区别
- String.IsNullOrWhiteSpace和String.IsNullOrEmpty的区别
- php中empty(),is_null(),isset(),bool之间的区别
- [转]PHP中判断空变量empty(),is_null(),isset()的区别
- ibatis 中isNull, isNotNull与isEmpty, isNotEmpty区别
- string.IsNullOrEmpty和string.IsNullOrWhiteSpace方法的区别
- PHP判断变量是否存在及函数isset() 、empty()与is_null的区别