1
あなたはカンマ区切りの文字列に文字列を集約ループ考えてみましょう:VB6でDistinct文字列を見つける最良の方法は何ですか?
Dim Result As String
For Each Something In Things
If Result <> vbNullString Then
Result = Result & ","
End If
Result = Result & SomeStringFunction(Something)
Next Something
動作しますが、どのような場合、私は唯一の明確な文字列をしたいですか?私は、このメソッドを使用してきたが、それは非常に "重い重量" ようだ:
Dim Dict As Dictionary
Set Dict = New Dictionary
For Each Something In Things
Dict(SomeStringFunction(Something)) = vbNullString
Next Something
Dim Result As String
Dim vKey As Variant
For Each vKey In Dict.Keys
If Result <> vbNullString Then
Result = Result & ","
End If
Result = Result & CStr(vKey)
Next vKey
Set Dict = Nothing