一个Memo 一个Listview
Listview 里的数据如下|a |oldman|asd |4534 |sfsd |asd |2345 |124 |123466 |kdxs
|43 |affd |fdhgf |dfhfh |sdggg |4364 |sfsdf |sdf |34645 |fse
|58 |boy |asd |4538 |sfsd |asd |2345 |124 |123466 |kdxsMemo 里的数据如下
{.oldman.} :*\/*~*~+/man\+
{.boy.} :*\/*~*~+/girl\+-----------
怎么样能够循环memo取 {.到.}里的内容 和 +/到\+里的内容 并且查找listview里每一条的第2列是否含有 {.到.}的内容找到含有 {.到.}的内容的那一条后修改它的第五列使他显示+/到\+里的内容
解决方案 »
- DELPHI怎么开发一个没有界面的Activex呀
- 创建窗体到容器中
- 如何查询两个时间之间的记录?
- Delphi中快捷键和功能键不能用了
- 怎样拿到 tprintdialog 所选中纸的长和宽?
- 求Delphi 7 Update1的序列号和验证码
- 请问大家,怎样使用jpg图像文件?
- 查询最基本问题,很简单。半小时后结帐。
- 操作日志获取ADO生成的SQL语句
- 7月23~25日将举办Delphi认证考前培训班,参加本次培训的学员将有资格参加随后举行的Delphi认证考试。
- 我用 adoconnection.open 方法测试数据库连接 如果连接不成功,测试过程中界面就跟假死没反映了?
- delphi 如何调用VC写的dll?
Str, Str2, Str5: string
sIndex, eIndex: Integer;
Str := '{.oldman.} :*\/*~*~+/man\+';
// 取{.到.}的内容之间的内容
sIndex := Pos('{.', str);
eIndex := Pos('.}', str);
if (sIndex > 0) and (eIndex >0) and (sIndex + 2 <= eIndex ) then
Str2 := copy(str, sIndex + 2, eIndex - sIndex - 2);
// 去+/到\+之间的内容
sIndex := Pos('+/', str);
eIndex := Pos('\+', str);
if (sIndex > 0) and (eIndex >0) and (sIndex + 2 <= eIndex ) then
Str5 := copy(str, sIndex + 2, eIndex - sIndex - 2);
// 替代listview中的内容
for I := 0 to listview.items.count - 1 do
begin
// listview第二列就是listitem的subitems[0],第五列就是listitem的subitems[3]
if Listview.Items.Item[I].subitems[0] = str2 then
Listview.Items.Item[I].subitems[3] := Str5;
end;