vb 去掉字符串的换行符
发布网友
发布时间:2023-09-06 20:10
我来回答
共1个回答
热心网友
时间:2024-12-12 21:37
下面两种方案,你看看哪个是你想要的效果。要查看以下代码的效果,只需要把代码放入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