亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stringprocess.bas

?? 這是一本學習串口編程喝計算機監控的好書里面是用VB開發的源代碼
?? BAS
字號:
Attribute VB_Name = "StringProcess"
    Option Explicit
    'no dependence

Public Function NextString(ByVal strSource As String, strD As String) As String
    Dim I As Long
    Dim J As Long
    
    I = InStr(1, strSource, strD, vbTextCompare)
    J = Len(strD)
    If I = 0 Then
        NextString = ""
    Else
        NextString = Mid(strSource, I + J)
    End If
End Function

Public Function GetLeftString(ByVal strSource As String, strD As String) As String
    Dim lLoc As Long
    
    lLoc = InStr(1, strSource, strD, vbTextCompare)
    If lLoc = 0 Then
        GetLeftString = ""
    Else
        GetLeftString = Left(strSource, lLoc - 1)
    End If
End Function

Public Function GetIncludeString(ByVal strSource As String, strD As String) As String
    Dim strTmp As String
    
    strTmp = GetInsideString(strSource, strD)
    If strTmp <> "" Then
        GetIncludeString = strD + strTmp + strD
    Else
        GetIncludeString = ""
    End If
End Function

Public Function GetNoTail(ByVal strSource As String, strD As String, nLocation As Integer) As String
    'I=0, for entire string
    Dim I As Integer
    Dim strTmp As String
    
    If nLocation = 0 Then
        GetNoTail = strSource
        Exit Function
    End If
    
    strTmp = NextString(strSource, strD)
    I = I + 1
    
    Do While I < nLocation And strTmp <> ""
        strTmp = NextString(strTmp, strD)
        I = I + 1
    Loop
    
    GetNoTail = strTmp
End Function

Public Function GetNoString(ByVal strSource As String, strD As String, nLocation As Integer) As String
    'Start from 0.
    Dim nlen As Integer
    
    nlen = Len(strD)
    If Left(strSource, nlen) <> strD Then strSource = strSource + strD
    
    GetNoString = GetLeftString(GetNoTail(strSource, strD, nLocation), strD)
End Function

Public Function GetLastString(ByVal strSource As String, strD As String) As String
    Dim I As Integer
    Dim nlen As Integer
      
    nlen = Len(strSource)
    If Mid(strSource, nlen) <> strD Then strSource = strSource + strD
      
    Do While GetNoString(strSource, strD, I) <> ""
        GetLastString = GetNoString(strSource, strD, I)
        I = I + 1
    Loop
End Function

Public Function ChangeTail(ByVal strSource As String, strD1 As String, strD2 As String) As String
    Dim nlen As Integer
    Dim strEnd As String
    
    nlen = Len(strD1)
    strEnd = Mid(strSource, Len(strSource) - nlen + 1)
    
    If strEnd = strD1 Then
        ChangeTail = Left(strSource, Len(strSource) - nlen) + strD2
    Else
        ChangeTail = strSource
    End If
End Function

Public Function GetInsideString(ByVal strSource As String, strD As String) As String
    Dim strTmp As String
    Dim nLenOfStrD As Integer
    Dim I As Long
    
    strTmp = strSource
    If Len(strTmp) < 3 Or strD = "" Then Exit Function
    
    nLenOfStrD = Len(strD)
    I = InStr(1, strTmp, strD, vbTextCompare)
    
    If I <> 0 Then
        strTmp = Mid(strTmp, I + nLenOfStrD)
        GetInsideString = GetLeftString(strTmp, strD)
    End If
End Function

Public Function ChCharsCount(ByVal strSource As String) As Long
    Dim lLen As Long
    Dim lTmp As Long
    Dim lCode As Long
    Dim lCount As Long
    Dim strCh As String
    
    If strSource = "" Then Exit Function
    
    lLen = Len(strSource)
    For lTmp = 1 To lLen
        strCh = Mid(strSource, lTmp, 1)
        lCode = AscW(strCh)
        If lCode > 255 Or lCode < 0 Then lCount = lCount + 1
    Next lTmp
    
    ChCharsCount = lCount
End Function

Public Function FeatureCount(ByVal strSource As String, strFeature As String) As Long
    Dim I As Long
    Dim strTmp As String
    Dim nlen As Long
    Dim nCount As Long
    
    If strFeature = "" Then Exit Function
    
    strTmp = strSource
    nlen = Len(strTmp)
    I = InStr(1, strTmp, strFeature, vbTextCompare)
    strTmp = NextString(strTmp, strFeature)
    
    Do While I > 0
        nCount = nCount + 1
        
        I = InStr(1, strTmp, strFeature, vbTextCompare)
        strTmp = NextString(strTmp, strFeature)
        DoEvents
    Loop
    
    FeatureCount = nCount
End Function

Public Function OnlyOneSegChar(ByVal strSource As String, strSegment As String, bDelHead As Boolean) As String
    'if "**", use only a "*", ABAB to AB
    Dim strD2 As String
    Dim strTmp As String
    Dim nLoc As Long
    
    If strSource = "" Or strSegment = "" Then
        OnlyOneSegChar = strSource
        Exit Function
    End If
    
    strTmp = strSource
    If bDelHead = True Then
        Do While Mid(strTmp, 1, Len(strSegment)) = strSegment
            strTmp = Mid(strTmp, 1 + Len(strSegment))
            DoEvents
        Loop
    End If
    
    strD2 = strSegment + strSegment
    nLoc = InStr(1, strSource, strD2)
    Do While nLoc <> 0
        strTmp = Mid(strTmp, 1, nLoc + Len(strSegment) - 1) + Mid(strTmp, nLoc + Len(strD2))
        nLoc = InStr(1, strTmp, strD2)
        DoEvents
    Loop
    OnlyOneSegChar = strTmp
End Function

Public Function SegmentChars(ByVal strSource As String, nlen As Integer, strD As String) As String
    Dim I As Integer
    Dim strTmp As String
    Dim strResult As String
    
    If strSource = "" Or nlen < 1 Then Exit Function
    
    For I = 1 To Len(strSource)
        strTmp = Mid(strSource, I, nlen)
        If Len(strTmp) < nlen Then Exit For
        strResult = strResult + strTmp + strD
    Next I
    
    SegmentChars = strResult
End Function

Public Function DelAllSubChars(ByVal strSource As String, strSubChars As String) As String
    Dim lLoc As Long
    Dim nTmp As Integer
    Dim strTmp As String
    
    strTmp = strSource
    nTmp = Len(strSubChars)
    
    If strTmp = "" Or nTmp = 0 Then
        DelAllSubChars = strSource
        Exit Function
    End If
    
    lLoc = InStr(1, strTmp, strSubChars)
    
    Do While lLoc > 0
        strTmp = Mid(strTmp, 1, lLoc - 1) + Mid(strTmp, lLoc + nTmp)
        lLoc = InStr(lLoc, strTmp, strSubChars)
        DoEvents
    Loop
    
    DelAllSubChars = strTmp
End Function

Public Function InsertUniqueString(strSource As String, strWord As String, strD As String, nEnd As Integer) As String
    'But "春天" > "我們".
    Dim I As Integer
    Dim strTmp As String
    Dim nLoc As Long
    
    If strSource = "" Then
        InsertUniqueString = strWord + strD
        Exit Function
    Else
        If InStr(1, strSource, strWord, vbTextCompare) <> 0 Then
            InsertUniqueString = strSource
            Exit Function
        End If
        
        If nEnd = 0 Then
            'by order
            strTmp = GetNoString(strSource, strD, I)
            Do While strTmp < strWord
                If strTmp = "" Then Exit Do
                I = I + 1
                strTmp = GetNoString(strSource, strD, I)
                DoEvents
            Loop
            
            If strTmp = "" Then
                InsertUniqueString = strSource + strWord + strD
            Else
                nLoc = InStr(1, strSource, strTmp, vbTextCompare)
                InsertUniqueString = Mid(strSource, 1, nLoc - 1) + strWord + strD + Mid(strSource, nLoc)
            End If
        Else
            InsertUniqueString = strSource + strWord + strD
        End If
    End If
End Function

Public Function InsertSpecialChar(ByVal strSource As String, strSegment As String, strD As String) As String
    'from "我們12的祖國。" to "我們*祖國*"
    Dim strTmp As String
    Dim lLocation As Long
    
    If Len(strD) > 1 Then
        MsgBox "The length of segmentChar must less than 2!", vbExclamation + vbOKOnly
        InsertSpecialChar = strSource
        Exit Function
    End If
    
    strTmp = strSource
    
    For lLocation = 1 To Len(strTmp)
        If InStr(1, strSegment, Mid(strTmp, lLocation, 1)) <> 0 Then
            strTmp = Mid(strTmp, 1, lLocation - 1) + strD + Mid(strTmp, lLocation + 1)
        End If
        DoEvents
    Next lLocation
    
    'use only a "*"
    InsertSpecialChar = OnlyOneSegChar(strTmp, strD, True)
End Function

Public Function CheckLegalChars(ByVal strSource As String, ByVal strStandard As String) As Boolean
    Dim nlen As Integer
    Dim I As Integer
    Dim bError As Boolean
    
    If strSource = "" Or strStandard = "" Then Exit Function
    
    nlen = Len(strSource)
    
    For I = 1 To nlen
        If InStr(1, strStandard, Mid(strSource, I, 1)) = 0 Then
            bError = True
            Exit For
        End If
    Next I
    
    If bError = True Then
        CheckLegalChars = False
    Else
        CheckLegalChars = True
    End If
End Function

Public Function GetSeconds(strTime As String) As Long
    Dim nH, nM, nS As Long
    On Error Resume Next
    
    nH = Val(GetNoString(strTime, ":", 0))
    nM = Val(GetNoString(strTime, ":", 1))
    nS = Val(GetNoTail(strTime, ":", 2))
    GetSeconds = (nH * 60 + nM) * 60 + nS
End Function

Public Function GetHMS(sTotal As Long) As String
    Dim nH, nM, nS As Long
    On Error GoTo ErrProcess
    
    If sTotal < 0 Then GoTo ErrProcess 'The second day
    nH = sTotal \ 3600
    sTotal = sTotal - nH * 3600
    nM = sTotal \ 60
    nS = sTotal - nM * 60
    GetHMS = Trim(Str(nH)) + ":" + Trim(Str(nM)) + ":" + Trim(Str(nS))
    GetHMS = Format(GetHMS, "H:MM:SS")
    Exit Function
    
ErrProcess:
    GetHMS = "0:00:00"
End Function

Public Function GetEndChar(ByVal strSource As String) As String
    Dim lLen As Long
    
    lLen = Len(strSource)
    If lLen > 0 Then GetEndChar = Mid(strSource, lLen, 1)
End Function

Public Function GetStringBetweenTwoChars(ByVal strSource As String, nLocation As Integer, strStart As String, strEnd As String) As String
    Dim strTmp As String
    Dim nStart As Integer
    Dim nEnd As Integer
    
    nStart = InStr(nLocation, strSource, strStart, vbTextCompare)
    If nStart = 0 Then Exit Function
    
    nEnd = InStr(nStart, strSource, strEnd, vbTextCompare)
    If nEnd = 0 Then Exit Function
    If nEnd <= nStart Then Exit Function
    
    GetStringBetweenTwoChars = Mid(strSource, nStart + Len(strStart), nEnd - nStart - Len(strStart))
End Function

Public Function InsertString(strSource As String, strSub As String, nLoc As Integer) As String
    If nLoc < 1 Then InsertString = strSource
    If nLoc > Len(strSource) Then InsertString = strSource + strSub
    
    If nLoc >= 1 And nLoc <= Len(strSource) Then
        InsertString = Mid(strSource, 1, nLoc - 1) + strSub + Mid(strSource, nLoc)
    End If
End Function

Public Function ts(ByVal vData As Variant) As String  'ts: trim(str(data))
    ts = Trim(Str(vData))
End Function

Public Function TwoDigit(ByVal nData As Integer) As String
    If nData > 99 Then Exit Function
    TwoDigit = Format(nData, "0#")
End Function

Public Function GetMonthEnd(ByVal strSource As String) As String
    'from 2005-11-xx to 2005-11-30
    Dim nYear As Integer
    Dim nMonth As Integer
    Dim strTmp As String
    Dim dTmp As Date
    
    nYear = Val(GetNoString(strSource, "-", 0))
    nMonth = Val(GetNoString(strSource, "-", 1))
    
    If nMonth = 12 Then
        strTmp = ts(nYear + 1) + "-01-01"
    Else
        strTmp = ts(nYear) + "-" + ts(nMonth + 1) + "-1"
    End If
        
    dTmp = CDate(strTmp)
    GetMonthEnd = Format(dTmp - 1, "yyyy-mm-dd")
End Function

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费观看高清完整版在线观看熊| 91精品福利在线一区二区三区| 久久国产麻豆精品| 亚洲成人一区在线| 天天综合网 天天综合色| 视频一区二区不卡| 蜜臀av在线播放一区二区三区| 欧美aaaaa成人免费观看视频| 男男成人高潮片免费网站| 日本在线不卡一区| 国产专区综合网| jizzjizzjizz欧美| 在线亚洲人成电影网站色www| 欧亚洲嫩模精品一区三区| 欧美精品在线观看播放| 日韩精品自拍偷拍| 国产精品久久久久影院亚瑟| 亚洲激情图片qvod| 日产欧产美韩系列久久99| 国产综合色产在线精品 | 精品美女在线播放| 中文字幕不卡在线观看| 一区二区三区波多野结衣在线观看| 亚洲少妇最新在线视频| 日韩精品亚洲一区| 国产成人av一区二区三区在线| 91一区一区三区| 欧美精品视频www在线观看| 久久久久久夜精品精品免费| 亚洲人成网站色在线观看| 五月天丁香久久| jizz一区二区| 日韩久久久精品| 亚洲视频中文字幕| 精品亚洲国产成人av制服丝袜| caoporen国产精品视频| 宅男噜噜噜66一区二区66| 欧美国产精品中文字幕| 日韩 欧美一区二区三区| 不卡电影一区二区三区| 欧美一区二区福利在线| 亚洲综合在线视频| 国产成人精品免费一区二区| 欧美精品日韩一本| 中文字幕一区二区三区不卡在线| 蜜乳av一区二区三区| 97精品国产露脸对白| 久久亚洲一区二区三区四区| 亚洲二区在线观看| 91蝌蚪porny九色| 国产欧美一区二区精品忘忧草| 午夜精品在线看| 一本高清dvd不卡在线观看| 久久免费午夜影院| 久久99久久久欧美国产| 欧美色中文字幕| 最新高清无码专区| 成人av电影在线播放| xnxx国产精品| 精品影院一区二区久久久| 欧美日韩国产高清一区二区三区| 亚洲欧美视频在线观看视频| 不卡的av在线| 亚洲图片你懂的| 色哟哟国产精品| **性色生活片久久毛片| 99热精品一区二区| 中文字幕亚洲成人| 91在线你懂得| 一区二区三区欧美日韩| 在线影院国内精品| 亚洲自拍偷拍欧美| 欧美日韩一区三区| 丝袜国产日韩另类美女| 91精品国产手机| 美腿丝袜在线亚洲一区| 日韩午夜激情电影| 国产在线一区二区| 亚洲国产精品精华液ab| 国产成人av电影在线播放| 国产日韩欧美综合在线| 成人精品鲁一区一区二区| 国产日韩欧美电影| 91麻豆自制传媒国产之光| 一区二区在线观看av| 欧美色图天堂网| 日韩和欧美的一区| 久久综合久久综合九色| 成人性生交大片免费看中文网站| 亚洲少妇30p| 91精品视频网| 国产·精品毛片| 一卡二卡欧美日韩| 日韩一区二区三区精品视频| 国模一区二区三区白浆| 成人免费一区二区三区视频 | 555www色欧美视频| 极品美女销魂一区二区三区免费| 欧美激情在线一区二区三区| 91看片淫黄大片一级在线观看| 亚洲成av人片在线观看| 欧美精品一区二区三区一线天视频| 成人国产精品免费网站| 亚洲成人动漫在线免费观看| 久久久久久99久久久精品网站| 99国内精品久久| 麻豆精品国产91久久久久久| 亚洲视频在线一区| 精品国免费一区二区三区| 色视频一区二区| 国产一区二区三区免费观看| 亚洲黄色在线视频| 日韩精品一区二区三区视频在线观看| 成人av资源网站| 青青草91视频| 亚洲一区二区欧美| 国产欧美视频在线观看| 欧美色视频在线观看| 国产91精品在线观看| 亚洲成av人片| 一区二区三区在线免费观看| 国产网红主播福利一区二区| 911精品产国品一二三产区| 成人手机电影网| 紧缚奴在线一区二区三区| 天天影视色香欲综合网老头| 欧美激情一区二区三区| 精品乱人伦小说| 在线不卡中文字幕播放| 一本久久a久久免费精品不卡| 国产在线播放一区三区四| 视频一区免费在线观看| 亚洲午夜成aⅴ人片| 亚洲欧美日韩系列| 亚洲欧美影音先锋| 久久久精品免费观看| 精品精品国产高清一毛片一天堂| 欧美日韩免费电影| 欧美影视一区二区三区| 日本福利一区二区| 91天堂素人约啪| 色偷偷久久人人79超碰人人澡| 国产成人h网站| 国产精品一级黄| 成人综合婷婷国产精品久久蜜臀 | 欧美少妇一区二区| 日本韩国欧美三级| 欧美天堂一区二区三区| 欧美日韩视频在线第一区| 在线观看国产精品网站| 色婷婷国产精品综合在线观看| 97精品国产露脸对白| 日本韩国欧美一区二区三区| 欧美日韩综合在线| 欧美久久久一区| 日韩精品在线一区二区| 精品国产99国产精品| 国产欧美一区视频| 中文字幕巨乱亚洲| 一区二区三区在线影院| 一区二区三区欧美亚洲| 日韩国产精品久久久| 美女国产一区二区| 成人综合激情网| 欧美最猛黑人xxxxx猛交| 777午夜精品免费视频| 精品久久久久一区二区国产| 中文字幕欧美日本乱码一线二线| 国产精品久久久久天堂| 一片黄亚洲嫩模| 久草中文综合在线| av午夜精品一区二区三区| 在线看日韩精品电影| 欧美一个色资源| 日本一区二区成人| 亚洲一区二区三区四区在线免费观看 | 日韩精品乱码免费| 国产一区欧美日韩| 9i在线看片成人免费| 欧美日韩久久久一区| 国产偷国产偷亚洲高清人白洁| 中文字幕亚洲在| 蜜臀av国产精品久久久久| av在线不卡电影| 欧美一区二区三区免费大片| 中文在线一区二区| 免费观看成人av| 91免费版pro下载短视频| 精品国产第一区二区三区观看体验| 国产精品蜜臀在线观看| 美女网站在线免费欧美精品| 91丨九色丨黑人外教| 日韩久久久精品| 亚洲午夜激情网站| a级高清视频欧美日韩| 欧美tickling挠脚心丨vk| 亚洲欧美区自拍先锋| 国产美女av一区二区三区| 欧美精品99久久久**| 国产精品乱码人人做人人爱 |