function AdjustLineBreaks(const S: string): string;
function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle): string;
Replaces every occurrence of #13 and #10 in S with the line-ending sequence appropriate for the current platform (#13#10 on Windows/DOS, #10 on Unix-like systems, #13 on classic Mac OS); the overload with Style lets the caller force a specific line-ending convention instead of the platform default.
function FormatBuf(var Buffer; BufLen: Cardinal; const Fmt; fmtLen: Cardinal; const Args: array of Const): Cardinal;
function FormatBuf(var Buffer; BufLen: Cardinal; const Fmt; fmtLen: Cardinal; const Args: array of Const; const FormatSettings: TFormatSettings): Cardinal;
Formats the Fmt buffer (of length fmtLen) with the given Args, exactly as Format does, and stores up to BufLen bytes of the result in Buffer; returns the number of bytes written.
function Format(const Fmt: string; const Args: array of Const): string;
function Format(const Fmt: string; const Args: array of Const; const FormatSettings: TFormatSettings): string;
Replaces every placeholder of the form %[Index:][-][Width][.Precision]ArgType in Fmt with the corresponding element from Args and returns the resulting string; Index selects which argument to use (default the next one in sequence), '-' left-aligns padded output, Width sets a minimum field width, and Precision refines how the value is rendered depending on ArgType. Raises EConvertError on a malformed format string, a type mismatch with the next argument, or too few arguments.
| Type | Meaning |
| D | Decimal integer, zero-padded to at least Precision digits if given. |
| E | Scientific notation via FloatToStrF(Argument, ffExponent, Precision, 3). |
| F | Fixed-point notation; Precision sets the number of decimal digits. |
| G | General number format: fixed or scientific, whichever is shorter. |
| M | Currency format (fixed-point plus currency symbol). |
| N | Like fixed-point, but with thousand separators inserted. |
| P | Pointer value as an 8-character hexadecimal string. |
| S | String argument, optionally truncated to Precision characters. |
| U | Unsigned decimal integer, zero-padded to at least Precision digits if given. |
| X | Hexadecimal integer, padded to at least Precision characters (max 32). |
procedure FmtStr(var Res: string; const Fmt: string; const args: array of Const);
procedure FmtStr(var Res: string; const Fmt: string; const args: array of Const; const FormatSettings: TFormatSettings);
Calls Format with Fmt and args and stores the resulting string in Res; raises EConvertError on the same errors as Format.
function QuotedStr(const S: string): string;
Returns S enclosed in single quotes, with every embedded single quote doubled; equivalent to calling AnsiQuotedStr(S, '''').
function StrFmt(Buffer: PChar; Fmt: PChar; const args: array of Const): Pchar;
function StrFmt(Buffer: PChar; Fmt: PChar; const Args: array of Const; const FormatSettings: TFormatSettings): PChar;
Formats Fmt with args as Format does and stores the result in Buffer, returning Buffer; Buffer must point to enough space to hold the entire result.
function StrLFmt(Buffer: PCHar; Maxlen: Cardinal; Fmt: PChar; const args: array of Const): Pchar;
function StrLFmt(Buffer: PCHar; Maxlen: Cardinal; Fmt: PChar; const args: array of Const; const FormatSettings: TFormatSettings): Pchar;
Formats Fmt with args as Format does, but writes at most Maxlen characters of the result into Buffer, returning Buffer; Buffer must have room for Maxlen characters.
function TrimLeft(const S: string): string;
function TrimLeft(const S: widestring): widestring;
function TrimLeft(const S: unicodestring): unicodestring;
Strips blank characters (all characters with an ordinal value of 32 or less) from the beginning of S and returns the result; returns an empty string if S consists only of such characters.
function TrimRight(const S: string): string;
function TrimRight(const S: widestring): widestring;
function TrimRight(const S: unicodestring): unicodestring;
Strips blank characters (all characters with an ordinal value of 32 or less) from the end of S and returns the result; returns an empty string if S consists only of such characters.
function Trim(const S: string): string;
function Trim(const S: widestring): widestring;
function Trim(const S: unicodestring): unicodestring;
Strips blank characters (all characters with an ordinal value of 32 or less) from both the beginning and end of S and returns the result; returns an empty string if S consists only of such characters.
Other routines in SysUtils:
File Name Handling Routines,
File Input/Output Routines,
Date/Time Routines,
Conversion Routines,
String Functions,
Formatting Strings,
PChar Related Functions.