VB检测数组中的重复元素

VB检测数组中的重复元素,第1张

概述'需要点击菜单:工程->引用->Microsoft Scripting Runtime Public Function HasRepeat(ByRef arr() As String) As Boolean Dim dict As Dictionary Set dict = New Dictionary Dim i As Variant For Each i
'需要点击菜单:工程->引用->MicrosoftScriptingRuntime
Public Function HasRepeat(ByRef arr() As String) As Boolean    Dim dict As Dictionary    Set dict = New Dictionary    Dim i As Variant    For Each i In arr        If i <> "" Then            If dict.Exists(i) Then                HasRepeat = True                Exit Function            Else                dict.Add i,0            End If        End If    Next    HasRepeat = FalseEnd Function
总结

以上是内存溢出为你收集整理的VB检测数组中的重复元素全部内容,希望文章能够帮你解决VB检测数组中的重复元素所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1281538.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-09
下一篇2022-06-09

发表评论

登录后才能评论

评论列表(0条)

    保存