kitasue
2020/08/22 (土) 04:42:18
ce705@e9d43
標準モジュールに以下を定義すると、
Function f_strInsAfter(strOrg As String, strBgn As String, strEnd As String, strIns As String) As String
Dim p1 As Long
Dim p2 As Long
p1 = InStr(strOrg, strBgn)
If p1 = 0 Then
f_strInsAfter = strOrg
Exit Function
End If
p2 = InStr(p1, strOrg, strEnd)
If p2 = 0 Then
f_strInsAfter = strOrg
Exit Function
End If
If Len(strOrg) < (p2 + Len(strEnd)) Then
f_strInsAfter = Left(strOrg, p2 + Len(strEnd) - 1) & strIns
Else
f_strInsAfter = Left(strOrg, p2 + Len(strEnd) - 1) & strIns & f_strInsAfter(Mid(strOrg, p2 + Len(strEnd)), strBgn, strEnd, strIns)
End If
End Function
f_strInsAfter([説明文],"<img",">","<br>")
がご所望の文字列を返します。
通報 ...