Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.5   9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2    Statistic  


Replaces newline characters.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Text 2.4 Yes Yes Yes Yes Yes
MBS( "Text.ReplaceNewline"; Text; Mode { ; Wrap } )   More

(old name: String.ReplaceNewline)


Parameter Description Example value
Text The text to process. "Hello World"
Mode The operation mode. First a value for the output newline type: 0 = nothing, 1 = CR (Mac), 2 = LF (Unix), 3 = CRLF (Windows), 4 = <br> for html, 5 = <br /> for xml. Second you can add 8 to remove duplicate newlines.
Wrap Optional
Optional whether to wrap lines longer than given number of characters. Default is 0 for no wrap.


Text with modified newline characters.


Replaces newline characters.
Can remove, convert to Mac, Windows and Linux specific end of line characters. Also can remove duplicates.
FileMaker uses Mac line endings on all platforms.


Remove newlines from field:

MBS( "Text.ReplaceNewline"; Test Database::TextField; 0 )

Replaces newlines from field with Mac newlines:

MBS( "Text.ReplaceNewline"; Test Database::TextField; 1 )

Replaces newlines from field with Mac newlines and remove duplicates:

MBS( "Text.ReplaceNewline"; Test Database::TextField; 1+8 )

Write UTF-8 CRLF file:

Set Variable [ $text ; Value: "Joe,1234 Main St.¶John Glen,3132 Elm¶Johnson,5233 Wreybird¶Ray,263 Birch¶äöü" ]
Set Variable [ $path ; Value: "/Users/cs/Desktop/test.txt" ]
Set Variable [ $text ; Value: MBS( "Text.ReplaceNewline"; $text; 3) // CRLF ]
Set Variable [ $r ; Value: MBS( "Text.WriteTextFile"; $text; $path; "UTF8" ) ]

See also

Example Databases

Blog Entries

FileMaker Magazin

  • Ausgabe 5/2018, Seite 29

Created 18th August 2014, last changed 3th August 2017

Text.ReplaceAll   -   Text.Serialize

Feedback: Report problem or ask question.

MBS FileMaker Plugins