First and foremost that code will cause errors, simply because
lol is a string not an array so you cannot access it the way you are in
num. What you would have to do is make make lol into a string array, like this
- string lol = "112233aabbcc";
-
string[] array = lol.Split(new char[] {','});
You next problem is the item at index 0 is a string not an int so that would make your code puke. You need to convert it to an int first, like this:
- int temp = 0;
-
-
if(int.TryParse(array[0], out temp))
-
{
-
int num = temp;
-
}
So now we have working C# code, now we can convert it to VB.NET:
- Dim lol As String = "112233aabbcc"
-
Dim array As String() = lol.Split(New Char() {","C})
-
Dim temp As Integer = 0
-
Dim num As Integer
-
-
If Integer.TryParse(array(0), temp) Then
-
num = temp
-
End If
NOTE: This was written in notepad because I have no IDE open so it's just a sample of what you're looking for and this should give you a good start