How to Remove Line Break in String

前端 未结 13 2187
旧时难觅i
旧时难觅i 2020-12-09 01:16

I want to Remove the Line Break from the string if my string Ends with Line Break.

Sub linebreak(myString)
    If Len(myString) <> 0 Then
        If Rig         


        
13条回答
  •  感动是毒
    2020-12-09 01:45

    Private Sub Form_Load()
        Dim s As String
    
        s = "test" & vbCrLf & "this" & vbCrLf & vbCrLf
        Debug.Print (s & Len(s))
    
        s = Left(s, Len(s) - Len(vbCrLf))
        Debug.Print (s & Len(s))
    End Sub
    

提交回复
热议问题