• StrUtils


      StrUtils包含大多数字符串操作 

    //类似  AAAA 类似于ABAAA
    function ResemblesText(const AText, AOther: string): Boolean; overload;
    function AnsiResemblesText(const AText, AOther: string): Boolean; overload;

    //包含
    function ContainsText(const AText, ASubText: string): Boolean; inline; overload;
    function AnsiContainsText(const AText, ASubText: string): Boolean; overload;

    //是否以ASubText开始
    function StartsText(const ASubText, AText: string): Boolean; inline; overload;
    function AnsiStartsText(const ASubText, AText: string): Boolean; overload;

    //是否以ASubText结束
    function EndsText(const ASubText, AText: string): Boolean; inline; overload;
    function AnsiEndsText(const ASubText, AText: string): Boolean; overload;

    //替换字符串
    function ReplaceText(const AText, AFromText, AToText: string): string; inline; overload;
    function AnsiReplaceText(const AText, AFromText, AToText: string): string; overload;

    //匹配字符串
    function MatchText(const AText: string; const AValues: array of string): Boolean; overload;
    function AnsiMatchText(const AText: string; const AValues: array of string): Boolean; overload;

    //返回索引值
    function IndexText(const AText: string; const AValues: array of string): Integer; overload;
    function AnsiIndexText(const AText: string; const AValues: array of string): Integer; overload;

    //以上函数不区分大小写

    //下面函数区分大小写
    function ContainsStr(const AText, ASubText: string): Boolean; inline; overload;
    function AnsiContainsStr(const AText, ASubText: string): Boolean; overload;

    function StartsStr(const ASubText, AText: string): Boolean; inline; overload;
    function AnsiStartsStr(const ASubText, AText: string): Boolean; overload;

    function EndsStr(const ASubText, AText: string): Boolean; inline; overload;
    function AnsiEndsStr(const ASubText, AText: string): Boolean; overload;

    function ReplaceStr(const AText, AFromText, AToText: string): string; inline; overload;
    function AnsiReplaceStr(const AText, AFromText, AToText: string): string; overload;

    function MatchStr(const AText: string; const AValues: array of string): Boolean; overload;
    function AnsiMatchStr(const AText: string; const AValues: array of string): Boolean; overload;

    function IndexStr(const AText: string; const AValues: array of string): Integer; overload;
    function AnsiIndexStr(const AText: string; const AValues: array of string): Integer; overload;

    //字符串重复次数
    function DupeString(const AText: string; ACount: Integer): string; overload;

    //反转字符串
    function ReverseString(const AText: string): string; overload;
    function AnsiReverseString(const AText: string): string; overload;

    function StuffString(const AText: string; AStart, ALength: Cardinal;
    const ASubText: string): string; overload;

    //随机从数组中取字符串
    function RandomFrom(const AValues: array of string): string; overload;


    //功能和三元操作一样 a > b ? 0:1
    function IfThen(AValue: Boolean; const ATrue: string;
    AFalse: string = ''): string; overload; inline;

    //分离字符串返回字符串数组
    function SplitString(const S, Delimiters: string): TStringDynArray;

    //从左边截取字符串
    function LeftStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
    function LeftStr(const AText: WideString; const ACount: Integer): WideString; overload;

    //从右边截取字符串
    function RightStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
    function RightStr(const AText: WideString; const ACount: Integer): WideString; overload;

    //从中间截取字符串
    function MidStr(const AText: AnsiString; const AStart, ACount: Integer): AnsiString; overload;
    function MidStr(const AText: WideString; const AStart, ACount: Integer): WideString; overload;


     

  • 相关阅读:
    联想 Vibe Shot(Z90-3) 免recovery 获取ROOT权限 救砖 VIBEUI V3.1_1625
    联想 Z5S(L78071)免解锁BL 免rec 保留数据 ROOT Magisk Xposed 救砖 ZUI 10.5.370
    联想 Z5(L78011) 免解锁BL 免rec 保留数据 ROOT Magisk Xposed 救砖 ZUI 10.5.254
    联想 S5 Pro(L78041)免解锁BL 免rec 保留数据 ROOT Magisk Xposed 救砖 ZUI 5.0.123
    第二阶段 冲刺八
    第二阶段 冲刺七
    第二阶段 冲刺六
    第二阶段 冲刺五
    代码大全阅读笔记03
    学习进度十二
  • 原文地址:https://www.cnblogs.com/pengshaomin/p/2340677.html
Copyright © 2020-2023  润新知