📜  序列函数 vb.net - BASIC 代码示例

📅  最后修改于: 2022-03-11 14:52:02.210000             🧑  作者: Mango

代码示例1
Private Function SequentialNumbers(ByVal input As String) As Boolean
        Dim numbers() As Int32 = Array.ConvertAll(input.ToCharArray(), Function(c) Convert.ToInt32(c))
        For index As Int32 = 0 To numbers.Length - 2
            For nestedIndex As Int32 = index + 1 To numbers.Length - 1
                If numbers(index) = numbers(nestedIndex) - 1 Then
                    Return True
                End If
            Next
        Next

        Return False
    End Function