dim j(10) as stringdim s as strings = join(j)if trim(s)="" then'' ''code end if
同上不知道在那里看过的那篇优化程序的文章是这样说的! if Val(trim(s))=0 then''
刚才的Val()用错了~ 应该是:if Len(trim(s))=0 then 才对! 如果该值不是全部空格,是有空格也有其它字符的格式,需这样做才可以!
最简单的办法:dim i as long dim str as string dim myarr(20) as string .................. for i=0 to ubound(myarr) str=str & myarr(i) nextif len(str)=0 then MSGBOX "空字符!" end if
''code
end if
if Val(trim(s))=0 then''
应该是:if Len(trim(s))=0 then 才对!
如果该值不是全部空格,是有空格也有其它字符的格式,需这样做才可以!
最简单的办法:dim i as long
dim str as string
dim myarr(20) as string
..................
for i=0 to ubound(myarr)
str=str & myarr(i)
nextif len(str)=0 then
MSGBOX "空字符!"
end if