Use
ExplodeString() to breakup the string into a 2d array and
Format() to format a string.
PHP Code:
char[] ip = "127.0.0.1";
char buffer[4][32];
int splits = ExplodeString(ip, ".", buffer, sizeof(buffer), sizeof(buffer[]));
if (splits != 4)
ThrowError("Is not IPv4");
//Output:
// buffer[0] = 127
// buffer[1] = 0
// buffer[2] = 0
// buffer[3] = 1
char first[32];
char second[32];
Format(first, sizeof(first), "%s.%s", buffer[0], buffer[1]);
Format(second, sizeof(second), "%s.%s", buffer[2], buffer[3]);
//Output:
// first = 127.0
// second = 0.1