Trying to convert a received DatagramPacket to string, but I have a small problem. Not sure what\'s the best way to go about it.
The data I\'ll be receiving is most
Try
System.out.println("Received: "+new String(buffer).trim());
or
String sentence = new String(packet.getData()).trim(); System.out.println("Received: "+sentence);