取字母

Sub text()
Dim i As Integer
Dim txt As String
Dim texnkyy As String
texnyy = ""
txt = "face"
For i = 1 To Len(txt)

‘ Len =多少个字符
If Not Mid(txt, i, 1) Like "[aeiou]" Then   

Mid =截取字符串      Like =集合                                                                

’第一个等不等于aeiou
texnyy = texnyy & Mid(txt, i, 1)
End If
Next
Debug.Print texnyy, Len(texnyy)

‘显示它 
Debug.Print Len(txt)

End Sub

posted @ 2020-03-02 22:56  星翊  阅读(120)  评论(2编辑  收藏  举报