关于vb 字符串 去空格
PrivateSubCommand1_Click()DimaAsStringstrflv="target=new></A>href=title=子"a=Replace(s...
Private Sub Command1_Click()
Dim a As String
strflv = "target=new></A> href= title= 子"
a = Replace(strflv, "<A", "")
a = Replace(strflv, "title=", "")
a = Replace(strflv, ":", "")
a = Replace(strflv, "href=", "")
a = Replace(strflv, "target=new></A>", "")
a = Replace(a, " ", "")
Print a
为什么不能过滤干净?
我只要保留 “子”
End Sub 展开
Dim a As String
strflv = "target=new></A> href= title= 子"
a = Replace(strflv, "<A", "")
a = Replace(strflv, "title=", "")
a = Replace(strflv, ":", "")
a = Replace(strflv, "href=", "")
a = Replace(strflv, "target=new></A>", "")
a = Replace(a, " ", "")
Print a
为什么不能过滤干净?
我只要保留 “子”
End Sub 展开
展开全部
你只想保留中文字吗?还是有什么特别要求?
追问
只是要步骤 子 只是例子
追答
Private Sub Command1_Click()
Dim a As String
strflv = "target=new> href= title= 子"
For i = 1 To Len(strflv)
If Asc(Mid(strflv, i, 1)) < 0 Then a = a & Mid(strflv, i, 1) '是中文就选上
Next
Print a
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询