十万火急!!!遇到难以解决的难题!!!
我用"&"把字符串A和字符串B连接起来形成字符串C,为何字符串C中间存在一个空格?例:t="123" & "ok"
=>t="123 ok"
我想拼出一个文件名并打开,而电脑可认不出中间有空格的文件名!老是碰到这个麻烦,谁有解决问题的办法,恳求各位了!
'删除字符串里所有的空白 Public Function AllTrim(Dwith As String) As String Dwith = Trim(Dwith) If Len(Dwith) = 0 Then Exit Function Do W = InStr(Dwith, " ") If W = 0 Then Exit Do Dwith = Left(Dwith, W - 1) & Right(Dwith, Len(Dwith) - W) Loop AllTrim = Dwith End Function
函数用法: 调用AllTrim 要被处理的字符串 = AllTrim 要被处理的字符串 t="123" & "ok" t= AllTrim (t)