c-string question

I am trying to remove a line-feed from the end of a c-string. But I can't figure out why this code doesn't work.
message is char[20]

// Original
Serial.print(F("Message Length= "));
Serial.println(strlen(message));

// what is the character before the null?
int j=strlen(message)-1;
Serial.print(F("Last char= "));
Serial.println(message[j],DEC);

// If the character at j is a LF, replace it with a null.
if(j==10) message[j]='\0';

// Did it work?
Serial.print(F("Message Length= "));
Serial.println(strlen(message));
Serial.print(F("Last char= "));
j=strlen(message)-1;
Serial.println(message[j],DEC);

The output is:

Message Length= 8
Last char= 10
Message Length= 8
Last char= 10

Nothing changed. Why?

I haven't used a String class for a few weeks thanks to the guidance of the folks here. And I have no plans to ever go back.

What's happening is that I am receiving an MQTT payload that sometimes ends with an LF. My thinking was to simply test the last character for the LF character, and if found, change the LF character to a null '\0'.

So, why isn't my code working?

And, I am sure there's a better way, so I'm open to suggestions.

if(j==10) message[j]='\0';

j doesn't equal 10. message[j] equals 10. j equals 7 in your code I do believe.

As Charlie Brown would say: "AAAARRRRRRGGGGGHHHHH"!
OR as Homer puts it:
HomerDoh.jpg

HomerDoh.jpg