📜  vba 删除最后一个 vbcrlf - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:53.182000             🧑  作者: Mango

代码示例1
' Removes the Line Break from the string if my string Ends with Line Break
Sub RemoveLineBreak(myString)
    If Len(myString) > 0 Then
        If Right$(myString, 2) = vbCrLf Or Right$(myString, 2) = vbNewLine Then 
            myString = Left$(myString, Len(myString) - 2)
        End If
    End If
End Sub