EndOfLine

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)

Returns an end-of-line terminator.

Shared Properties
Android fa-lock-32.png LF fa-lock-32.png Windows fa-lock-32.png
CR fa-lock-32.png Native fa-lock-32.png iOS fa-lock-32.png
CRLF fa-lock-32.png Unix fa-lock-32.png macOS fa-lock-32.png

Usage

result = EndOfLine

Part Type Description
result String The end of line String for the platform being compiled.

or
result = EndOfLine.EndOfLineType

Part Type Description
result String The end of line String specified by EndOfLineType.
EndofLineType String The end of line String being requested.

The choices are:

  • Windows
  • Unix
  • macOS

Notes

As indicated by the syntax, EndOfLine can be used in either of two ways. You can call one of its properties to get the line ending for that platform or you can call it without accessing any of its properties. In that case, it returns the EndOfLine character or character string for the platform being compiled.

Use the ReplaceLineEndings function to convert the line endings of text from one line ending to another.

On macOS

fa-info-circle-32.png
Starting with 2013r1, EndOfLine returns EndOfLine.Unix on all macOS apps.

You can also use EndOfLine.macOS, which is equivalent.

Sample Code

The following example specifies Unix line endings.

Var cr As String
cr = EndOfLine.Unix
TextField1.Text = "Hello world" + cr + "Such as it is."

See Also

String.ReplaceLineEndings function.