Public Class KeptNumberPatternArg
Public RawString As String
Public ResultList As ArrayList = New ArrayList()
Public Sub New()
'For i As Integer = 0 To 9
' Dim myList As List(Of Integer) = New List(Of Integer)()
' ResultList.Add(myList)
'Next
End Sub
End Class
............
............
............
Public Shared Function KeptNumberFromString(ByVal varInputString As String) As KeptNumberPatternArg
Dim rData As KeptNumberPatternArg = New KeptNumberPatternArg()
Dim tempStr As String = varInputString.Trim()
rData.RawString = tempStr
If (tempStr.Length > 0) Then
For i As Integer = 0 To 9
Dim NumCh As String = i.ToString()
Dim iPos As Integer = 0
Dim myList As List(Of Integer) = New List(Of Integer)()
Do
iPos = tempStr.IndexOf(NumCh, iPos)
If (iPos >= 0) Then
myList.Add(iPos)
End If
Loop Until (iPos = -1)
rData.ResultList.Add(myList)
Next
End If
Return rData
End Function