用惯了c++builder,这次接触delphi,关于字符串的处理方法,把delphi中所有的字符串处理函数翻了个遍似乎没有嘛?如果自己遍却嫌麻烦:(

解决方案 »

  1.   

    substring = copy(sourcestring,startpos,substringlength)
      

  2.   

    Copy()
    LeftStr()
    RightStr()
    AnsiReplaceStr()
      

  3.   

    说实话,delphi处理字符串功能比BCB可强多了,别的不说,就看strutils单元那些函数就知道了
      

  4.   

    Returns the substring of a specified length that appears at a specified position in a string.UnitStrUtilsCategorystring handling routinesDelphi syntax:function MidStr(const AText: AnsiString; const AStart, ACount: Integer): AnsiString; overload;
    function MidStr(const AText: WideString; const AStart, ACount: Integer): WideString; overload;C++ syntax:extern PACKAGE AnsiString __fastcall MidStr(const AnsiString AText, int AStart, int ACount);
    extern PACKAGE WideString __fastcall MidStr(const WideString AText, int AStart, int ACount);