Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature may not be available in some browsers.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim aN() As Integer
Dim q As Integer
q = StringaNumToArrayNum(TextBox1.Text, aN)
ListBox1.Items.Clear()
For k As Integer = 1 To q
ListBox1.Items.Add(aN(k))
Next
MsgBox("Numeri totali " & q)
End Sub
Public Function StringaNumToArrayNum(sNumeri As String, ByRef aRetN() As Integer) As Integer
Dim sChr As String
Dim sValue As String = ""
Dim q As Integer
Dim n As Integer
ReDim aRetN(90)
For k As Integer = 0 To sNumeri.Length - 1
sChr = sNumeri.Substring(k, 1)
If IsNumeric(sChr) Then
sValue = sValue & sChr
Else
If sValue.Trim <> "" Then
n = Convert.ToInt32(sValue)
If n >= 0 And n <= 90 Then
q += 1
aRetN(q) = n
End If
sValue = ""
End If
End If
Next
If sValue.Trim <> "" Then
n = Convert.ToInt32(sValue)
If n >= 0 And n <= 90 Then
q += 1
aRetN(q) = n
End If
sValue = ""
End If
ReDim Preserve aRetN(q)
Return q
End Function
Public Function StringaNumToArrayNum(sNumeri As String, ByRef aRetN() As Boolean) As Integer
End Function
Public Function StringaNumToArrayNum(sNumeri As String, ByRef aRetN() As Boolean) As Integer
Dim sChr As String
Dim sValue As String = ""
Dim q As Integer
Dim n As Integer
ReDim aRetN(90)
For n = 0 To 90
aRetN(n) = False
Next
For k As Integer = 0 To sNumeri.Length - 1
sChr = sNumeri.Substring(k, 1)
If IsNumeric(sChr) Then
sValue = sValue & sChr
Else
If sValue.Trim <> "" Then
n = Convert.ToInt32(sValue)
If n >= 0 And n <= 90 Then
q += 1
aRetN(n) = True
End If
sValue = ""
End If
End If
Next
If sValue.Trim <> "" Then
n = Convert.ToInt32(sValue)
If n >= 0 And n <= 90 Then
q += 1
aRetN(n) = True
End If
sValue = ""
End If
' ReDim Preserve aRetN(q)
Return q
End Function