EndOfLine
Class EndOfLine
| Method Prototype | Description
|
| Function Operator_Add( rhs As String ) As String | prepend HTTP line ending to a string
|
| Function Operator_AddRight( lhs As String ) As String | append HTTP line ending to a string
|
| Function Operator_Compare( other As String ) As Integer | compare HTTP line ending to a string
|
| Function Operator_Convert() As String | convert to a string as the HTTP line ending
|
| Shared Function HTML() As String | return an HTML line ending, "<br />"
|
| Shared Function HTTP() As String | return the HTTP line ending: Chr(13)+Chr(10)
|
| Shared Function Macintosh() As String | return the classic Mac line ending: Chr(13)
|
| Shared Function Unix() As String | return the Unix line ending: Chr(10)
|
| Shared Function Windows() As String | return the Windows line ending: Chr(13)+Chr(10)
|
Shared method:
| Method Prototype | Description
|
| Function EndOfLine() As EndOfLine | return the standard EndOfLine instance
|
The EndOfLine class represents line breaks, including all major platforms as well as line breaks used by HTTP and HTML. It includes comparison and conversion operators so that you can use it like a string (in which case it represents the HTTP line break). Or, you can explicitly call out type of line ending you want, as EndOfLine.Unix for example.
Although EndOfLine is a class, there is a global function (also called EndOfLine) that returns a static instance of that class. This means that you never need to explicitly declare and instantiate EndOfLine; instead, just refer to it via this global function, like so:
Print "Hello" + EndOfLine + "there!"
myOutputStream.Write "Line1" + EndOfLine.Unix + "Line2"
See the
ReplaceLineEndings function for a convenient way to replace all line endings in a block of text.