I have a string as a parameter in my method and i am trying to print the length of the string in which i have succeded but I want to add a zero in front of the length if it is less than 10.
I am getting the int cannot be referenced error, and not sure what the correct way of doing this is.
public void sendMessage(String message) throws ProtocolException {
physicalLayer.sendFrame("<" + "E" + "-"
+ message.length().toString().padleft(2, '0')
+ "-" + message + "-" + "00" + ">");
}
Thanks