摘要:
经常有需求 要判断不能为空,后台老是鄙视不做非空判断的前端 ,木办法 只能写一个。第一种想法:我不就是判断 是不是nil就可以了么。结果发现太天真,用户可以输入空格。对于这种蛋疼的用户,只能采取蛋疼的方法:-(Bool) isEmpty:(NSString *) str { if (!str) { return true; } else {//A character set containing only the whitespace characters space (U+0020) and tab (U+0009) and the newline and nextline cha... 阅读全文
posted @ 2012-11-08 22:12
SuperHappy
阅读(6915)
评论(0)
推荐(2)

浙公网安备 33010602011771号