Unit 'sysutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

AdjustLineBreaks

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

Declaration

Source position: sysstrh.inc line 116

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, or the specified platform if the 'Style' parameter was specified.

The platform-specific line-ending characters are:

Errors

None.

See also

AnsiCompareStr

  

Compare 2 ansistrings, case sensitive, using locale settings.

AnsiCompareText

  

Compare 2 ansistrings, case insensitive, using locale settings.

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.

Documentation generated on: Dec 22 2024