张兴才同性微博:一个VB的问题

来源:百度文库 编辑:高校问答 时间:2024/05/04 17:06:19
我要写一个程序,比较两个字符串,如果其中一个字符串里包含另一个,那么就把他们共有的那个字符串显示在一个TextBox里,请问要怎样写这个程序?谢谢
我是这样写的:
If(StrComp(Text2.Text, Text3.Text))=Ture Then
“这里要怎样写”“注:我想要两个TextBox里面的相同内容显示在Text4里”
End If

if InStr(str1, str2) then TextBox1.text = str1 'str1包含在str2中
if InStr(str1, str2) then TextBox1.text = str2 'str2包含在str1中