Delphi
RTL API Reference
Delphi 运行时库 SysUtils 单元,提供字符串、格式化、文件与类型转换等基础函数。
By EZ4Code Team
SysUtils
Delphi SysUtils 单元的核心例程集合。
IntToStr(value: Integer): string将整数转换为字符串。
Returns: string,整数的字符串表示
StrToInt(s: string): Integer将字符串转换为整数,失败抛出异常。
Returns: Integer,解析得到的整数
Format(fmt: string; args: array of const): string按格式字符串格式化参数列表。
Returns: string,格式化后的字符串
Trim(s: string): string去除字符串首尾空白字符。
Returns: string,去除空白后的字符串
Pos(substr, s: string): Integer返回子串在字符串中首次出现的位置(从 1 开始),未找到返回 0。
Returns: Integer,子串起始位置(1-based),0 表示未找到
Copy(s: string; start, count: Integer): string从字符串指定位置(1-based)截取指定长度的子串。
Returns: string,截取的子串
AssignFile(var f: File; name: string)将文件变量与文件名关联,准备后续 IO 操作。
Returns: void,无返回值,建立关联
TryStrToInt(s: string; out value: Integer): Boolean尝试将字符串转为整数,成功返回 True 并通过 out 参数返回结果。
Returns: Boolean,转换是否成功