H hnxx2003 Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #2 var s:string; begin if trim(s)+'a'='a' then showmessage('s is empty !'); end; //---you can try it
Z ZRWeng Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #4 ?? 如: String s=""; if (s.Equals("")) .....
W wwwwb Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #5 if length(trim(s))<1 thwn showmessage('s is empty !');
石 石之轩 Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #6 我也是这样写的s.Equals("") 结果运行到这儿出错,System.NullReferenceException 未将对象引用设置到对象实例 ?
L lkr Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #7 当然了,S没有初始化的结果就是这样的! 任何变量使用之前都需要初始化,所以 string s=new string() 是很必要的!