***************************************************************
文字列の右端を1文字削除(値指定の場合、指定値の場合のみ除去)
【引数】Value :対象の文字列
Chop :除去したい値
Compare :文字列判定方法(VbCompareMethodに準拠)
***************************************************************
Public Function fString_Right_Chop(Value As String, Optional Chop As String, Optional Compare As VbCompareMethod = vbBinaryCompare) As String
If Value = "" Then Exit Function
If Chop = "" Then
fString_Right_Chop = Left$(Value, Len(Value) - 1)
ElseIf Value <> "" Then
If fString_Right_With(Value, Chop, Compare) = True Then
fString_Right_Chop = Left$(Value, Len(Value) - Len(Chop))
Else
fString_Right_Chop = Value
End If
End If
End Function