I have an ip-address which I want to split in 4 octets. I get the ip-address using the network-library. The problem is that I can't, using Regex.split, split the ip-address by using a dot (.) as pattern.
Here is my code:
Instead of a List, I tried using an array but there is no difference.
The problem is in this line:
myOctets is always = 0
Perhaps I am using Regex.split not in the correct manner.
Can anyone help to get this to work? Thanks.
Here is my code:
B4X:
Dim mynetwork As ServerSocket
Dim DeviceIpAddress As String
DeviceIpAddress=mynetwork.GetMyIP 'GetMyIp returns a string-value.
'Let us say - 192.168.1.4
'now split ip-address in 4 octets
Dim myOctets As List
myOctets.Initialize
myOctets=Regex.Split(".",DeviceIpAddress)
For x = 0 To myOctets.Size -1
Msgbox(myOctets.Get(x),"")
Next
Instead of a List, I tried using an array but there is no difference.
The problem is in this line:
B4X:
myOctets=Regex.Split(".",DeviceIpAddress)
myOctets is always = 0
Perhaps I am using Regex.split not in the correct manner.
Can anyone help to get this to work? Thanks.