字符串函数大全(35) 例子 Edit1.Text := Format(Edit2.Text, [StrToFloatDef(Edit.3.Text, 0)]); ━━━━━━━━━━━━━━━━━━━━━ 首部 procedure FmtStr(var Result: string; const Format: string; const Args: array of const); $[SysUtils.pas 功能 按指定方式格式化一个数组常量的字符形式返回 说明 <参见Format> 参考 function SysUtils.FormatBuf;function System.Length;function System.SetLength 例子 <参见Format> ━━━━━━━━━━━━━━━━━━━━━ 首部 function StrFmt(Buffer, Format: PChar; const Args: array of const): PChar; $[SysUtils.pas 功能 返回按指定方式格式化一个数组常量的字符指针形式 说明 如果Buffer和Format其中只要有一个为nil则返回nil 参考 function SysUtils.FormatBuf 例子 <参见Format> ━━━━━━━━━━━━━━━━━━━━━ 首部 function StrLFmt(Buffer: PChar; MaxBufLen: Cardinal; Format: PChar; const Args: array of const): PChar; $[SysUtils.pas 功能 返回按指定方式和长度格式化一个数组常量的字符指针形式 说明 StrLFmt(VBuffer, 6, '%d12345', [1024]) = '10241'; 参考 function SysUtils.FormatBuf 例子 <参见Format> ━━━━━━━━━━━━━━━━━━━━━ 首部 function FormatBuf(var Buffer; BufLen: Cardinal; const Format; FmtLen: Cardinal; const Args: array of const): Cardinal; $[SysUtils.pas 功能 返回按指定方式格式化一个数组常量到缓冲区Buffer中