高分悬赏,VB的text中如何提取特征相同内容?急!

来源:百度知道 编辑:UC知道 时间:2024/06/16 06:58:37
如在text1中的内容是
【第0002行】 03
【第0003行】 01
【第0004行】 04
【第0005行】 01
【第0006行】 02
【第0007行】 05
text2的内容是
【第0003行】
【第0004行】
【第0006行】
按下commder1,text3中就会显示
【第0003行】 01
【第0004行】 04
【第0006行】 02
就是把text1中有text2特征的行给提取到text3中去
请各位大师帮帮忙,一定要写出完整的代码,我是初学的,没有代码根本看不懂,不写代码的可以省心了。答好了我给60分再追分。小妹我急用

在 command1的 onclick事件里面

dim srcLines as string()=text1.Text.Split(vbCrLf)
dim lines as string()=text2.Text.Split(vbCrLf)

text3.text = string.empty

for each line as string in lines
for each srcLine as string in srcLines
if srcLine.startWith(line) then
text3.text += srcLine + vbCrLf
end if
next
next