delphi里有没有像vb中left(),right()的函数?
.
参考答案:用copy
==============================
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
s:String;
begin
s:='***********';
ShowMessage(copy(s,2,3));
//left
ShowMessage(Copy(s,Length(s)-4,length(s)));
//right
end;
end.