Howto save IPAdress from WiFi.localIP() to String

I am trying to save the ip addresst returned by WiFi.locaIP() into a string for manipulation. But it returns an IPAddress object. I want to convert it to a String.

Something like this:

String myIPAddrStr = "Initial string";
myIPAddrStr = String(WiFi.localIP());    <-- pseudocode, this obviously does not work

How can I get the results of localIP() saved as a String? It's not for the purpose of Serial.println(WiFii.localIP()), which works just fine. I want to manipulate the String.

Thanks.

/s/ Martin

Use sprintf to turn numbers into c-string.

sprintf(buffer,"%d:%d:%d:%d", ip[0],ip[1],ip[2],ip[3]); //also pseudocode.

Then you can use String() if you want. I don't know why String is better to manipulate than integers but you didn't say.

Thanks very much.

/s/ Martin