Android Question Spliting Of IPAddress

Rajesh Gupta

Member
Licensed User
Hii All,

I want to split IPAddress, I am using the following code but its not working.
Please Help:-

Dim IpadrressToSplit() As String = Regex.Split(".", 192.168.0.44)

txtIP1.Text = IpadrressToSplit(0)
txtIP2.Text = IpadrressToSplit(1)
txtIP3.Text = IpadrressToSplit(2)
txtIP4.Text = IpadrressToSplit(3)
 

DonManfred

Expert
Licensed User
Longtime User
The dot has a special meaning in regex. It must be escaped...

B4X:
    Dim IpadrressToSplit() As String = Regex.Split("\.", "192.168.0.44")

    Log(IpadrressToSplit(0))
    Log(IpadrressToSplit(1))
    Log(IpadrressToSplit(2))
    Log(IpadrressToSplit(3))
 
Upvote 0
Top