您的位置:首页 > 编程语言 > Delphi

常用字符串处理函数 Delphi

2013-04-22 13:58 423 查看
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); 将字符串的值转换为其数字表示式
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: