应该使用AnsiPos查找"["或者"]"的位置,在用Copy拷贝。
解决方案 »
- 谁能推荐个能将 word文件 转换为 pdf 的控件.
- 请教一个简单的问题
- 如果调用在另一个工程里的单位文件里的函数 我在这个新的项目里如何调用呢?
- 怎样才能把LCDNumber控件加到控件夹中……??
- 为什么show一个窗体后,以前的窗体就不见了?
- 请问一个关于toolbar和coolbar的用法
- ★★★★★★ 关于拖动过程,请教高手 ★★★★★★
- mdi主窗口放edit,mdi子窗口放dbgrid,高分求解!
- Unit RzCommon was compiled with a different version of Graphics.clMenuBar
- Delphi6下载!!
- 500分求救!!!!!!!!!!
- 十分钟内结贴
var
Pos1,Pos2:Integer;
begin
Pos1 := AnsiPos('[',Str);
Pos2 := AnsiPos(']',Str);
Str2 := Copy(Str,Pos1 + 1, Pos2 - Pos1);
……
end;
var
s, Result: string;
Index1, Index2 : Integer;
begin
s := 'Hello[world]';
Index1 := Pos('[', s);
Index2 := Pos(']', s);
result := Copy(s, Index1 + 1, Index2- Index1 -1 );
ShowMessage(Result);
end;
pos(edit1.text,'“[”开头并且“]”');
begin
Result := False;
if Length[str] >= 1 then
if str[1] = '[' and str[Length(str)] = '[' then
Result := True;
end;