UDP comunication - Udp.write() problems

Hello everyone!

I used the code inside this link to do my project

this code, allows us to send udp packets.
It use the function -> Udp.write("Example!");

But in my project, i get some values from sensors and then, i want send by udp packet using Udp.write(). I have changed the values to String, and then i make a concatenation with a "|" separator. The final String is like that:

String sensors = "myTemperature+"|"+myHumidity;

Now i want to use Udp.write(sensors), but i get an error....

Can someone help me, please. Must be easy, but i can't find a solution.

Thank you so much

Udp.write probably doesn't take Strings. String class is a bad idea on a micro anyway. Use a char array instead of a String and you won't have this problem.

Udp.beginPacket(remoteIP, remotePort);

Hi john wasser!
thank you for your help. It works fine, i just change the separator to "|" to "-"