有以下字符串,我获取并存在了Memo中。然后进行截取自己需要的字符内容。document.getElementById('span_seriesmenu_class').innerHTML = "<select
name=\"seriesmenu_class_id\"><option value=\'\'>=====系列
=====</option><option value=16>北斗星</option><option value=17>浪迪
</option><option value=18>利亚纳</option><option value=19>爱迪尔
</option></select>";
function show_product__search(seriesmenu_class_id)
{
var tag = document.getElementById('script__class');
tag.src="/js/-" + seriesmenu_class_id + ".html";
if(tag.src!="/js/-" + seriesmenu_class_id + ".html")
{
var tag1=document.createElement('script');
tag1.setAttribute('src',"/js/-" + seriesmenu_class_id + ".html");
document.getElementById('script__class').appendChild(tag1);
}
}
================================================================现在我想获取北斗星
浪迪
利亚纳
爱迪尔这几个值,然后存到Memo中,不知道有没有办法实现呢?
name=\"seriesmenu_class_id\"><option value=\'\'>=====系列
=====</option><option value=16>北斗星</option><option value=17>浪迪
</option><option value=18>利亚纳</option><option value=19>爱迪尔
</option></select>";
function show_product__search(seriesmenu_class_id)
{
var tag = document.getElementById('script__class');
tag.src="/js/-" + seriesmenu_class_id + ".html";
if(tag.src!="/js/-" + seriesmenu_class_id + ".html")
{
var tag1=document.createElement('script');
tag1.setAttribute('src',"/js/-" + seriesmenu_class_id + ".html");
document.getElementById('script__class').appendChild(tag1);
}
}
================================================================现在我想获取北斗星
浪迪
利亚纳
爱迪尔这几个值,然后存到Memo中,不知道有没有办法实现呢?
uses
StrUtils;procedure TForm1.Button1Click(Sender: TObject);
var
s : String;
i, j, k: Integer;
begin
s := Memo1.Text;
Memo1.Lines.Clear;
i := Pos('<option value=', s);
while i > 0 do
begin
j := PosEx('>', s, i);
if j > i then
begin
k := PosEx('</option>', s, j);
if k > j then Memo1.Lines.Add(Trim(Copy(s, j + 1, k - j - 1)));
end;
i := PosEx('<option value=', s, k);
end;
end;