“xxx”.indexOf("")返回的是0。所以使用String.contains(str),如果str为""的话,返回的是true,坑爹呀。 转载于:https://my.oschina.net/u/3281835/blog/1005478