Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

moiskyrie34

Module Split
    Const Min As Integer=1
    Const Max As Integer=100
    Const NumStr As String="2-99"
    Dim NumArr,NumArr1 As String()
    Dim Count1,Count2 As Integer
    Dim Found As Boolean
    
    Sub Main()
        NumArr=NumStr.Split(",")
        
        For Count1=Min to Max
          Found=False
         
          For Count2=0 to NumArr.Length-1
            If InStr(1,NumArr(Count2),"-")>0 Then
              NumArr1=NumArr(Count2).Split("-")
   
              If Count1>=Convert.ToInt32(NumArr1(0)) And Count1<=Convert.ToInt32(NumArr1(1)) Then
                Found=True
                Exit For
              End If
            End If
          
            If Count1.ToString=NumArr(Count2) Then
              Found=True
              Exit For
            End If
          Next
          
          If Not Found Then Console.Write(Count1.ToString & ",")
        Next
    End Sub
End Module

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.