设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

指定字符开头和结束的查找

1970-1-1 08:00| 发布者: huanghai『文章』| 查看: 2253| 评论: 0


'使用方法:
'findstr("我来添加文章","来","加")
'=来添加

'-----------------------------
Public Function findStr(ByVal str As String, ByVal str1 As String, ByVal str2 As String)
    Dim a, b As Integer

    If InStr(1, str, str1, 1) <> 0 Then
        a = InStr(1, str, str1, 1)
        If InStr(a, str, str2, 1) <> 0 Then
            b = InStr(a, str, str2, 1)
            findStr = Mid(str, a, b - a + 1)
        End If
    End If

End Function

最新评论

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-4-29 23:30 , Processed in 0.073614 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部