ホーム > ライブラリ > String > fString_Right_With

ライブラリ

fString_Right_With

***************************************************************
文字列の右端が指定値か判定

【引数】Value :対象の文字列
              Find :検索値
              Compare :文字列判定方法(VbCompareMethodに準拠)
***************************************************************

Public Function fString_Right_With(Value As String, Find As String, Optional Compare As VbCompareMethod = vbBinaryCompare) As Boolean
    
    Dim At_With As Long
    
    If Value = "" Or Find = "" Then Exit Function
    
    At_With = InStrRev(Value, Find, , Compare)
    
    If At_With = 0 Then Exit Function
    
    If At_With + Len(Find) - 1 = Len(Value) Then
         fString_Right_With = True
    End If
    
End Function

String   2017/11/21   shono

この記事へのコメント

コメントを送る

 
※ メールは公開されません
Loading...
 画像の文字を入力してください