首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

怎样删除不含特定字符的行?解决办法

2012-01-15 
怎样删除不含特定字符的行?比如说:刘海莉05庞莹36陈奋飞10黄源02曾仁臻36孙晓敏12焦海辉24穆冰芳102陈琳10

怎样删除不含特定字符的行?
比如说:

刘海莉   05
庞莹   36
陈奋飞10
黄源   02
曾仁臻36
孙晓敏12
焦海辉24
穆冰芳102
陈琳10
李照45
王楷35

删除不含序号10的行,注意102是个整体.

谢谢

[解决办法]
Private Sub Command1_Click()
Dim strTest As String, strTest1 As String
strTest = "我10好 "
strTest1 = "123106 "
MsgBox IsCheckString(strTest)
End Sub

Private Function IsCheckString(ByVal strCheck As String) As Boolean
Dim intStart As Integer, intEnd As Integer
intStart = InStr(strCheck, "10 ")
If intStart > 0 Then
If IsNumeric(Mid(strCheck, intStart - 1, 1)) Then
IsCheckString = False
Exit Function
Else
If IsNumeric(Mid(strCheck, intStart + Len( "10 ") + 1, 1)) Then
IsCheckString = False
Exit Function
End If
End If
Else
IsCheckString = False
Exit Function
End If
IsCheckString = True
End Function
[解决办法]
正解

热点排行