Dim array1() As String
成都創(chuàng)新互聯(lián)成都網(wǎng)站建設(shè)按需定制,是成都網(wǎng)站維護(hù)公司,為成都木托盤提供網(wǎng)站建設(shè)服務(wù),有成熟的網(wǎng)站定制合作流程,提供網(wǎng)站定制設(shè)計(jì)服務(wù):原型圖制作、網(wǎng)站創(chuàng)意設(shè)計(jì)、前端HTML5制作、后臺(tái)程序開發(fā)等。成都網(wǎng)站設(shè)計(jì)熱線:13518219792
Dim array2() As Boolean
Dim i As Integer
Dim j As Integer
Dim str1 As String = "a,c,c,c,a,b,c,d,f,eee,eee"
array1 = Split(str1, ",")
str1 = ""
ReDim array2(UBound(array1))
For i = 0 To UBound(array1)
array2(i) = False
Next
For i = 0 To UBound(array1) - 1
If array2(i) = False Then
For j = i + 1 To UBound(array1)
If array1(i) = array1(j) And array2(j) = False Then
array2(j) = True
End If
Next j
End If
Next i
For i = 0 To UBound(array1)
If array2(i) = False Then
str1 = str1 array1(i) ","
End If
Next i
If str1 "" Then
str1 = Strings.Left(str1, Len(str1) - 1)
End If
比如數(shù)組a。里面有5個(gè)值,其中有3個(gè)是重復(fù)的?
如果這樣的話,很好辦哦。
新建一個(gè)數(shù)組b,然后遍歷要去除的數(shù)組a,
從a中把每一個(gè)都取出來,和新建的b里面的去比,如果有相同的,則不放入b,
否則就放入數(shù)組b,直到循環(huán)結(jié)束。
你第二和第三列是不重復(fù)的啊,如果你要去除重復(fù),可以在有重復(fù)的列前加distinct
例如,select distinct fldD from table
當(dāng)前文章:vb.net去重語句 vb去重排序
URL鏈接:http://www.chinadenli.net/article40/dddoeeo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動(dòng)態(tài)網(wǎng)站、商城網(wǎng)站、定制網(wǎng)站、定制開發(fā)、網(wǎng)站維護(hù)、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)