mytips@wiki
lsepa-指定した文字より左側を返す
最終更新:
mytips
-
view
lsepa-指定した文字より左側を返す
拡張子つきのファイル名からファイル名部分を取り出すときなどに使える。
Public Function lsepa(sOrg As String, sFind As String) As String
'-- sOrg より s Find を検索し、それより左側にある文字列を返す
'
Dim n As Integer
Dim sRet As String
n = InStr(1, sOrg, sFind)
If n = 0 Then
sRet = ""
Else
sRet = Mid(sOrg, 1, n - 1)
End If
lsepa = sRet
End Function