Such a clever use of dictionaries, but

I messed around with this code and found that Join function will not play nice since d.keys returns a variant array, not a string array.

I tried d.keys().stringtype, but RB refuses.

Not too familiar with dictionaries, is there any way to use the d.keys functions without running another loop?


Scott



On Sep 3, 2006, at 1:20 PM, Joe Huber wrote:



Seems to me this could be simplified even further

Function removeDuplicates(sourceString as string,delim as string) As string
  dim sourceList() as String = Split(sourceString, delim)
  dim d as new Dictionary
  for each item as string in sourceList
    d.Value(item) = true
  next

  return Join(d.keys, delim)
End Function

Regards,
Joe Huber
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to