Class

# EndOfLine

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Returns an end-of-line terminator.

## Usage

``` xojo
result = EndOfLine
```

| Part   | Type                             | Description                                                                       |
|--------|----------------------------------|-----------------------------------------------------------------------------------|
| result | `String</api/data_types/string>` | The end of line `String</api/data_types/string>` for the platform being compiled. |

**or**

``` xojo
result = EndOfLine.EndOfLineType
```

| Part          | Type                             | Description                                                                    |
|---------------|----------------------------------|--------------------------------------------------------------------------------|
| result        | `String</api/data_types/string>` | The end of line `String</api/data_types/string>` specified by *EndOfLineType*. |
| EndOfLineType | `String</api/data_types/string>` | The end of line `String</api/data_types/string>` being requested.              |

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                         | Type                             | Read-Only | Shared |
|------------------------------|----------------------------------|-----------|--------|
| `Android<endofline.android>` | `String</api/data_types/string>` | ✓         | ✓      |
| `CR<endofline.cr>`           | `String</api/data_types/string>` | ✓         | ✓      |
| `CRLF<endofline.crlf>`       | `String</api/data_types/string>` | ✓         | ✓      |
| `iOS<endofline.ios>`         | `String</api/data_types/string>` | ✓         | ✓      |
| `LF<endofline.lf>`           | `String</api/data_types/string>` | ✓         | ✓      |
| `macOS<endofline.macos>`     | `String</api/data_types/string>` | ✓         | ✓      |
| `Native<endofline.native>`   | `String</api/data_types/string>` | ✓         | ✓      |
| `UNIX<endofline.unix>`       | `String</api/data_types/string>` | ✓         | ✓      |
| `Windows<endofline.windows>` | `String</api/data_types/string>` | ✓         | ✓      |

## Property descriptions

<div id="endofline.android">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.Android

**Android** As `String</api/data_types/string>`

> The Android line ending, `Chr</api/text/chr>`(10).
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.cr">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.CR

**CR** As `String</api/data_types/string>`

> Carriage Return, `Chr</api/text/chr>`(13).
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.crlf">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.CRLF

**CRLF** As `String</api/data_types/string>`

> Carriage Return followed by Line Feed, `Chr</api/text/chr>`(13) + `Chr</api/text/chr>`(10).
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.ios">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.iOS

**iOS** As `String</api/data_types/string>`

> The iOS (and iPadOS) line ending, `Chr</api/text/chr>`(10).
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.lf">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.LF

**LF** As `String</api/data_types/string>`

> Line Feed, `Chr</api/text/chr>`(10).
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.macos">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.macOS

**macOS** As `String</api/data_types/string>`

> The macOS line ending as of macOS 10.0, `Chr</api/text/chr>`(10).
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.native">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.Native

**Native** As `String</api/data_types/string>`

> The line ending supplied by the OS upon which the app is running.
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.unix">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.UNIX

**UNIX** As `String</api/data_types/string>`

> The Unix line ending, `Chr</api/text/chr>`(10). This line ending is used by macOS and Linux.
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

<div id="endofline.windows">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

EndOfLine.Windows

**Windows** As `String</api/data_types/string>`

> The Windows line ending, `Chr(13)</api/text/chr>` + `Chr(10)</api/text/chr>`.
>
> This property is read-only.
>
> This property is `shared</api/language/shared>`.

## Notes

As indicated by the syntax, <span class="title-ref">EndOfLine</span> 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 <span class="title-ref">EndOfLine</span> character or character string for the platform being compiled.

Use the `String.ReplaceLineEndings<string.replacelineendings>` function to convert the line endings of text from one line ending to another.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### On macos

<div class="note">

<div class="title">

Note

</div>

Starting with 2013r1, <span class="title-ref">EndOfLine</span> returns `Unix<endofline.unix>` on all macOS apps.

</div>

You can also use `macOS<endofline.macos>`, which is equivalent.

## Sample code

The following example specifies Unix line endings.

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

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `String.ReplaceLineEndings<string.replacelineendings>` function.

</div>
