vb 去掉字符串的换行符
比如a=c:\qq.exe&vbcrlf&qq1.exe&vbcrlf&qq2.exe&vbcrlf用什么方法在每个.exe后面都跟上一个vbcrlf,如果.exe后面有...
比如a= c:\qq.exe & vbcrlf & qq1.exe & vbcrlf & qq2.exe & vbcrlf
用什么方法在每个.exe后面都跟上一个vbcrlf,如果.exe后面有vbcrlf则不加。如果没有则加,在字符串尾只能留一个vbcrlf,这样怎么弄呀? 展开
用什么方法在每个.exe后面都跟上一个vbcrlf,如果.exe后面有vbcrlf则不加。如果没有则加,在字符串尾只能留一个vbcrlf,这样怎么弄呀? 展开
展开全部
下面两种方案,你看看哪个是你想要的效果。要查看以下代码的效果,只需要把代码放入Form_Load即可
方案1:
Do While InStr(a, ".exe") <> 0
a = Replace(a, ".exe", ".eye" & vbCrLf)
Loop
Do While InStr(a, vbCrLf & vbCrLf) <> 0
a = Replace(a, vbCrLf & vbCrLf, vbCrLf)
Loop
Do While InStr(a, ".eye") <> 0
a = Replace(a, ".eye", ".exe")
Loop
MsgBox a
方案2:
Do While InStr(a, ".exe") <> 0
a = Replace(a, ".exe", ".eye & vbCrLf")
Loop
Do While InStr(a, " & vbCrLf & vbCrLf") <> 0
a = Replace(a, " & vbCrLf & vbCrLf", " & vbCrLf")
Loop
Do While InStr(a, ".eye") <> 0
a = Replace(a, ".eye", ".exe")
Loop
MsgBox a
方案1:
Do While InStr(a, ".exe") <> 0
a = Replace(a, ".exe", ".eye" & vbCrLf)
Loop
Do While InStr(a, vbCrLf & vbCrLf) <> 0
a = Replace(a, vbCrLf & vbCrLf, vbCrLf)
Loop
Do While InStr(a, ".eye") <> 0
a = Replace(a, ".eye", ".exe")
Loop
MsgBox a
方案2:
Do While InStr(a, ".exe") <> 0
a = Replace(a, ".exe", ".eye & vbCrLf")
Loop
Do While InStr(a, " & vbCrLf & vbCrLf") <> 0
a = Replace(a, " & vbCrLf & vbCrLf", " & vbCrLf")
Loop
Do While InStr(a, ".eye") <> 0
a = Replace(a, ".eye", ".exe")
Loop
MsgBox a
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询