Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i hava one 2d Array
Array1(0,A)
Array1(0,AC)
Array1(0,A) <--
Array1(0,AB)
Array1(1,CCC)
Array1(1,CCC)<--
Array1(1,ACC)
Array1(1,ABC)
<s/pre>
Expected 2d Array Like This  (<--) this values are Removed after createing new Array

<pre>
Array2(0,A)
Array2(0,AB)
Array2(0,ABC)
Array2(1,CCC)
Array2(1,ACC)
Array2(1,ABC)
<s/pre>

For Single Array i am using 
<pre>
  Dim aStudents : aStudents = Array("Arup", "John", "Mike", "John", "Lisa", "Arup")
  WScript.Echo Join(aStudents)
  Dim aUniqStudents : aUniqStudents = uniqFE(aStudents)
  WScript.Echo Join(aUniqStudents)

' returns an array of the unique items in for-each-able collection fex
Function uniqFE(fex)
  Dim dicTemp : Set dicTemp = CreateObject("Scripting.Dictionary")
  Dim xItem
  For Each xItem In fex
      dicTemp(xItem) = 0
  Next
  uniqFE = dicTemp.Keys()
End Function


when i use above logic apply on 2d Array its give me unique items but its given me value like this
Array1(0,A)
Array1(0,AC)
Array1(0,AB)
Array1(0,CCC)
Array1(0,ACC)
Array1(0,ABC)


index "1" will be remove in Dictionary
Posted
Updated 16-Dec-14 21:29pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900