Error in String.getBytes() ?

You can also do like this (don't know if it will be helpful to you):

String message = "Hello World";
Serial.print(message+" length="+message.length());
Serial.print(" (");
for (int i = 0; i < message.length(); i++){
  if (i > 0){
    Serial.print(" "); 
  }
  Serial.print(message[i],DEC);
}
Serial.println(")");

Same result, less functions call, less memory used... :slight_smile: