| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 580 人关注过本帖
标题:问个问题~~~!!!
只看楼主 加入收藏
小悟空
Rank: 1
等 级:新手上路
帖 子:218
专家分:0
注 册:2005-5-14
收藏
 问题点数:0 回复次数:5 
问个问题~~~!!!
有两个字符串,,,分别放到两个字符数组里面(两个字符串的内容不同),,,然后比较两个字符串,,,把两个字符串里面不同的字符存到另一个字符数组里面,,,比如说
第一个字符串A,,,里面有abcdefg,,,第二个字符串B,,,里面有abcdefghizk,,,把第二个字符串里面有的而第一个里面没有的存到一个数组里面,,,请问VB有没有涵数可以完成着个功能~~~!!!请高手指点一下,,,谢谢了~~~!!!
搜索更多相关主题的帖子: abcdefg 字符串 
2005-11-09 14:33
zmjls
Rank: 1
等 级:新手上路
帖 子:377
专家分:0
注 册:2005-9-30
收藏
得分:0 
漏.....NO.....

对ASP、.NET、SQL情有独钟的情圣王子! 俺目标:睡觉睡到自然醒数钱数到手抽筋!
2005-11-09 15:54
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 

没什么特殊的函数,不过应该是可以写出来的.


快上课了……
2005-11-09 18:46
freeforever
Rank: 4
等 级:业余侠客
威 望:3
帖 子:368
专家分:201
注 册:2005-11-2
收藏
得分:0 

'把下面这段存成".frm"文件,在VB中打开,试试是不是你要的
'(我一天只能贴5个文件,没有能贴的了)

VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3060
ClientLeft = 60
ClientTop = 450
ClientWidth = 4845
LinkTopic = "Form1"
ScaleHeight = 3060
ScaleWidth = 4845
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
BackColor = &H8000000B&
Height = 375
Left = 840
Locked = -1 'True
TabIndex = 7
Top = 1560
Width = 3375
End
Begin VB.CommandButton Command1
Caption = "Command1比较"
Height = 495
Left = 1320
TabIndex = 3
Top = 2400
Width = 2295
End
Begin VB.TextBox Text3
BackColor = &H8000000A&
Height = 375
Left = 840
Locked = -1 'True
TabIndex = 2
Top = 1080
Width = 3375
End
Begin VB.TextBox Text2
Height = 375
Left = 840
TabIndex = 1
Text = "15685615374123fgdjksla;fj"
Top = 600
Width = 3375
End
Begin VB.TextBox Text1
Height = 375
Left = 840
TabIndex = 0
Text = "15685615374123"
Top = 120
Width = 3375
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "串2:"
ForeColor = &H000000FF&
Height = 180
Index = 3
Left = 240
TabIndex = 8
Top = 1680
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "串2:"
Height = 180
Index = 2
Left = 240
TabIndex = 6
Top = 720
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "串1:"
ForeColor = &H000000FF&
Height = 180
Index = 1
Left = 240
TabIndex = 5
Top = 1200
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "串1:"
Height = 180
Index = 0
Left = 240
TabIndex = 4
Top = 240
Width = 360
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim str1 As String, str2 As String, str11 As String, str22 As String
Dim intLen As Integer, intI As Integer, intAsc1 As Integer, intAsc2 As Integer
If Len(Trim(Text1)) <> 0 And Len(Trim(Text2)) <> 0 Then
If Len(Trim(Text1)) < Len(Trim(Text2)) Then
intLen = Len(Trim(Text1))
Else
intLen = Len(Trim(Text2))
End If
Debug.Print intLen
For intI = 1 To intLen
If Mid(Text1, intI, 1) <> Mid(Text2, intI, 1) Then
str11 = str11 + Mid(Text1, intI, 1)
str22 = str22 + Mid(Text2, intI, 1)
Debug.Print
End If
Next intI
End If
Text3 = str11
Text4 = str22
End Sub



其实我也很无聊!
2005-11-10 16:25
slorelee
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2005-11-10
收藏
得分:0 
replace函数

2005-11-10 19:48
小悟空
Rank: 1
等 级:新手上路
帖 子:218
专家分:0
注 册:2005-5-14
收藏
得分:0 

谢谢了,,,自己想出来了~~~!!!但是还是要谢谢大家~~~!!!


2005-11-11 11:36
快速回复:问个问题~~~!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032663 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved