How to remove line break in a string using vbscript

Function LineBreak(myString)
    If Len(myString) <> 0 Then
        If Right$(myString, 2) = vbCrLf Or Right$(myString, 2) = vbNewLine Then 
            LineBreak= Left$(myString, Len(myString) - 2)
        End If
    End If
End Function

Reference

http://stackoverflow.com/questions/10024402/how-to-remove-line-break-in-string

Comments

Popular posts from this blog

How to write data into a excel file using vbscript

Format date as yyyy-mm-dd using vbscript