delphi中有没有像vb中的left,right函数? 用copy函数copy(string,iBginIndex,iEndIndex) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Delphi6中有。Delphi6扩展了很多常用函数。 //------------------------------------------------------------------------------function StrLeft(const S: AnsiString; Count: Integer): AnsiString;begin Result := Copy(S, 1, Count);end;//------------------------------------------------------------------------------function StrMid(const S: AnsiString; Start, Count: Integer): AnsiString;begin Result := Copy(S, Start, Count);end;//------------------------------------------------------------------------------function StrRight(const S: AnsiString; Count: Integer): AnsiString;begin Result := Copy(S, Length(S) - Count + 1, Count);end; 赫赫,楼上是老大写的;下面是Borland写的,位于StrUtils单元,都差不多!//------------------------------------------------------------------------------function LeftStr(const AText: string; const ACount: Integer): string;begin Result := Copy(AText, 1, ACount);end;//------------------------------------------------------------------------------function RightStr(const AText: string; const ACount: Integer): string;begin Result := Copy(AText, Length(AText) + 1 - ACount, ACount);end;//------------------------------------------------------------------------------function MidStr(const AText: string; const AStart, ACount: Integer): string;begin Result := Copy(AText, AStart, ACount);end; 在窗体上画一个黑白相间的圆(貌似足球平面图) delphi打印问题,在线等....... 新人问题 delphi 求余 动态创建TDataSetProvider后与DataSetProvider1的连接问题??? 一个小问题 高分求两个控件(急)! 用Tabel.AddIndex()方法给一个已建表建立索引,出现Table is busy错误,为什么? 关于多个同类控件的使用问题 超级难题!如何对系统属性中的某一个项目进行操作! 一个送分的线程问题 这个SQL语名该怎么写呢?急!急!急!急!急!急!急!急! 按ctrl+alt+del时不出现在关闭程序框,已下程序怎么用?
begin
Result := Copy(S, 1, Count);
end;//------------------------------------------------------------------------------function StrMid(const S: AnsiString; Start, Count: Integer): AnsiString;
begin
Result := Copy(S, Start, Count);
end;//------------------------------------------------------------------------------function StrRight(const S: AnsiString; Count: Integer): AnsiString;
begin
Result := Copy(S, Length(S) - Count + 1, Count);
end;
下面是Borland写的,位于StrUtils单元,都差不多!//------------------------------------------------------------------------------
function LeftStr(const AText: string; const ACount: Integer): string;
begin
Result := Copy(AText, 1, ACount);
end;
//------------------------------------------------------------------------------
function RightStr(const AText: string; const ACount: Integer): string;
begin
Result := Copy(AText, Length(AText) + 1 - ACount, ACount);
end;
//------------------------------------------------------------------------------
function MidStr(const AText: string; const AStart, ACount: Integer): string;
begin
Result := Copy(AText, AStart, ACount);
end;