以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [原创]如何判断数组中的重复值 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127903) |
-- 作者:无限5180 -- 发布时间:2018/11/24 17:05:00 -- [原创]如何判断数组中的重复值 列如有下面的数组,如何判断数组中有没有重复值,并提取这个重复值,请老师帮忙解答一下,谢谢! Dim nms() As String = {"22","11","流33","223","22","11"}
|
-- 作者:有点蓝 -- 发布时间:2018/11/24 17:26:00 -- Dim nms() As String = {"22","11","流33","223","22","11"} Dim lst As new List(of String) For Each s As String In nms If lst.Contains(s) Then Output.Show(s & "重复") Else lst.Add(s) End If Next
|