I have converted this existing C# .NET 2.0 code (which appears to take in a string with any characters and return only the numbers in that string):
private static string StripMIN(string min)
{
string result = string.Empty;
int digit = 0;
for (int i = 0; i < min.Length; i++)
{
if (int.TryParse(min[i].ToString(), out digit) == true)
{
result += min[i];
}
}
return result;
}
to this VB.Net .Net 1.1 code:
Private Function StripMIN(ByVal min As String) As String
Dim result As String = String.Empty
Dim digit As Integer = 0
Dim i As Integer = 0
While i < min.Length
Me.SystemMessages.Text = "Char at " + i + " : " + min(i)
If TryParseInteger(min(i).ToString(), digit) = True Then
result += min(i)
End If
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
Return result
End Function
I am getting an error message on line 6 of the VB.Net code at min(i)
. The error message reads:
"Expression is not an array or a method, and cannot have an argument list"
I am not very well versed in .Net 1.1 and cannot find an alternative solution to solving this error. Does anybody have any suggestions on how I can access each character of this string and verify that its a number and return only the numbers of the string in .Net 1.1?