常用字符串处理函数 Delphi
TStrings类的继承关系为:TObject-TPersistent
常用的字符串处理函数
函数名 语法 功能
AnsiCompareStr function AnsiCompareStr(const S1, S2: string): Integer; 用于比较两个大小写敏感的字符串
AnsiCompareText function AnsiCompareText(const S1, S2: string): Integer; 用于比较两个大小写不敏感的字符串
AnsiUpperCase function AnsiUpperCase(const S: string): string; 将字符串转换为全部大写
AnsiLowerCase function AnsiLowerCase(const S: string): string; 将字符串转换为全部小写
Appendstr procedure AppendStr(var Dest: string; const S: string); deprecated; 将给定字符串常量添加到目标字符串末尾
CompareStr function CompareStr(const S1, S2: string): Integer; 用于比较两个大小写敏感的字符串,其结果与区域设置无关
CompareText function CompareText(const S1, S2: string): Integer; 用于比较两个大小写不敏感的字符串,其结果与区域设置无关
Concat function Concat(s1 [, s2,..., sn]: string): string; 将一组字符串连接起来
Copy function Copy(S; Index, Count: Integer): string; 返回字符串的子串
Delete procedure Delete(var S: string; Index, Count:Integer); 从字符串中删除一个子串
Insert procedure Insert(Source: string; var S: string; Index: Integer); 在字符串的指定位置插入一个子串
Length function Length(S): Integer; 返回字符串中中字符的个数
Pos function Pos(Substr: string; S: string): Integer; 在字符串中搜索子串,返回的是索引值
LeftStr function LeftStr(const AText: AnsiString; const ACount: Integer): AnsiString; 返回从字符串左边开始指定长度的子串
RightStr function RightStr(const AText: AnsiString; const ACount: Integer): AnsiString; 返回从字符串末尾向前指定长度的子串
InttoStr function IntToStr(Value: Integer): string; 将整数转换为字符串
StrtoInt function StrToInt(const S: string): Integer; 将字符串转换为整数
LowerCase function LowerCase(const S: string): string; 转换为小写
UpperCase function UpperCase(const S: string): string; 转化为大写
Val procedure Val(S; var V; var Code: Integer); 将字符串的值转换为其数字表示式
posted on 2013-04-22 13:58 Waaaaaall-E 阅读(195) 评论(0) 收藏 举报
浙公网安备 33010602011771号