Skip to content

AdjustLineBreaks

Convert possible line-endings to the currently valid line ending.

Declaration

Source position: sysstrh.inc line 112

  function AdjustLineBreaks(const S: string) : string;
  function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle)
                            : string;

Description

AdjustLineBreaks will change all occurrences of #13 and #10 characters with the correct line-ending characters for the current platform. This is #13#10 on Windows and Dos. On Unix-like platforms, this is #10 and for Mac OS X it is #13.

Errors

None.

See also

Name Description
AnsiCompareStr Compare 2 ansistrings, case sensitive, ignoring accents characters.
AnsiCompareText Compare 2 ansistrings, case insensitive, ignoring accents characters.

Example

Program Example48;
{ This program demonstrates the AdjustLineBreaks function }
Uses sysutils;
Const
  S = 'This is a string'#13'with embedded'#10'linefeed and'+
       #13'CR characters';
Begin
  Writeln (AdjustLineBreaks(S));
End.