Foxtable(狐表)用户栏目专家坐堂 → 找出两个字符串的差异


  共有3173人关注过本帖树形打印复制链接

主题:找出两个字符串的差异

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/11/21 14:23:00 [显示全部帖子]

Dim des1 As String = "1,2,1,1,1,1,1,1,3,53,53,53,53,53,5,5,56,7"
Dim des2 As String = "1,2,1,1,1,1,1,1,3,53,53,53,53,53,5,5,56,7,530"
Dim ary1() As String = des1.Split(",")
Dim ary2() As String = des2.Split(",")
Dim ls As new List(Of String)
For Each s As String In ary2
    If array.IndexOf(ary1, s) < 0 AndAlso ls.Contains(s) = False Then
        ls.Add(s)
    End If
Next

For Each s As String In ary1
    If array.IndexOf(ary2, s) < 0 AndAlso ls.Contains(s) = False Then
        ls.Add(s)
    End If
Next

msgbox(String.Join(",",ls.ToArray))


 回到顶部