S[1] //取第一个字符
Length(S) //长度
Pos(SubStr, S) //SubStr在S中的位置
Copy(S, 1, 3) //左三个
Copy(S, Length(S) - 3, MaxInt) //右三个

解决方案 »

  1.   

    计算长度: Length(String);
    字符串位置: Pos(SubStr, String);
    取子串: Copy(String, Index, Count);'d:\program\data.sql'中把data.sql取出来:
    S := Copy('d:\program\data.sql', LastDelimiter('\') + 1, MaxInt);
      

  2.   

    length(string);
    pos(str,开始位置,长度);
    pos(str,(length(string)-长度),长度);var 
      str:='d:\program\data.sql';
    pos(str,length(str)-8,8);
      

  3.   

    计算长度: Length(String);
    字符串位置: Pos(SubStr, String);
    取子串: Copy(String, Index, Count);'d:\program\data.sql'中把data.sql取出来:
    S := Copy('d:\program\data.sql', LastDelimiter('\', 'd:\program\data.sql') + 1, MaxInt);
      

  4.   

    S[1] //取第一个字符
    Length(S) //长度
    Pos(SubStr, S) //SubStr在S中的位置
    Copy(S, 1, 3) //左三个
    Copy(S, Length(S) - 3, MaxInt) //右三个
      

  5.   

    定位:
    function Pos(Substr: string; S: string): Integer;右取:
    function RightStr(st: String; Len: Integer): String;左取:
    function LeftStr(const AText: string; ACount: Integer): string;
      

  6.   

    S[1] //取第一个字符
    Length(S) //长度
    Pos(SubStr, S) //SubStr在S中的位置
    Copy(S, 1, 3) //左三个
    Copy(S, Length(S) - 3, MaxInt) //右三个