var str,str2:string; strcount:=length(str); setlength(str2,strcount-2); if str[strcont]='d' and str[strcount-1]='n' and str[strconur-2]='a' then for i:=1 to strcount-2 do begin setlength(str2,strcount-2); str2:=str[i]; end;
var str,str2:string; strcount:=length(str); setlength(str2,strcount-2); if str[strcont]='d' and str[strcount-1]='n' and str[strconur-2]='a' then for i:=1 to strcount-2 do begin str2:=str[i]; end;
function copy(s:string;index,count:integer):string 意思:比如S=abcdef,copy(abcdef,4,6)的结果就是def,同样delete(abcdef,4,6)就是删除def;
var SourceStr,str2:string; begin SourceStr:='asdfasdfsdfasd111and'; if Copy(SourceStr,Length(SourceStr)-2,3)='and' then Str2:=Copy(SourceStr,1,Length(SourceStr)-3); end;
where
1=1
and
...
and
...
明白?and 都加再前面。
str,str2:string;
strcount:=length(str);
setlength(str2,strcount-2);
if str[strcont]='d' and str[strcount-1]='n' and str[strconur-2]='a' then
for i:=1 to strcount-2 do
begin
setlength(str2,strcount-2);
str2:=str[i];
end;
copy(s,n,m)从s里拷贝第n个开始的m个子串
delete(s,n,m)删除s里第n个开始的m个字符
str,str2:string;
strcount:=length(str);
setlength(str2,strcount-2);
if str[strcont]='d' and str[strcount-1]='n' and str[strconur-2]='a' then
for i:=1 to strcount-2 do
begin
str2:=str[i];
end;
意思:比如S=abcdef,copy(abcdef,4,6)的结果就是def,同样delete(abcdef,4,6)就是删除def;
SourceStr,str2:string;
begin
SourceStr:='asdfasdfsdfasd111and';
if Copy(SourceStr,Length(SourceStr)-2,3)='and' then
Str2:=Copy(SourceStr,1,Length(SourceStr)-3);
end;