⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myarraylist.vb

📁 Mastering VBNet Include Source Code
💻 VB
字号:
Option Strict On

Public Class myArrayList
    Inherits ArrayList
    Function Min() As String
        Dim i As Integer
        Dim minValue As String
        minValue = MyBase.Item(0).ToString
        For i = 1 To MyBase.Count - 1
            If MyBase.Item(i).ToString < minValue Then minValue = MyBase.Item(i).ToString
        Next
        Min = minValue
    End Function

    Function NumMin() As Double
        Dim i As Integer
        Dim minValue As Double
        minValue = 1.0E+230
        For i = 1 To MyBase.Count - 1
            If IsNumeric(MyBase.Item(i)) And Val(MyBase.Item(i).ToString) < minValue Then minValue = Val(MyBase.Item(i).ToString)
        Next
        NumMin = minValue
    End Function

    Function GetString() As String
        Dim i As Integer
        Dim strValue As String
        strValue = MyBase.Item(0).ToString
        For i = 1 To MyBase.Count - 1
            strValue = strValue & vbCrLf & MyBase.Item(i).ToString
        Next
        GetString = strValue
    End Function

    Sub EliminateDuplicates()
        Dim i As Integer = 0
        Dim delEntries As ArrayList
        While i <= MyBase.Count - 2
            Dim j As Integer = i + 1
            While j <= MyBase.Count - 1
                If MyBase.Item(i).ToString = MyBase.Item(j).ToString Then
                    MyBase.RemoveAt(j)
                End If
                j = j + 1
            End While
            i = i + 1
        End While
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -