使用String.IsNullOrEmpty来判断字符串是否为空.

String.IsNullOrEmpty

本文地址: <script type="text/javascript">var path=document.URL;document.write(document.URL)</script>

发布于 <script type="text/javascript">var path=document.URL;date=path.substring(40,44);month=path.substring(45,47);day=path.substring(48,50);document.write(date+'年'+month+'月'+day+'日');</script>

以前判断字符串是否空,一直使用s == null || s.Length == 0,今天在Captain Jack 上看到一篇文章,才知道String类还有这么一个函数String.IsNullOrEmpty(),它可以用来判断字符串是否为空。

虽然Captain Jack说它效率会慢点,但是我认为这种百万级别的比较太少见了。还是用系统提供的这个吧。我太懒了...老喜欢用系统提供的.

本文地址: <script type="text/javascript">document.write(document.URL)</script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值