String deleting

Hello!

I'm sending the following string through bluetooth to my Arduino: "Hello\n". On the Arduino side, I'm receiving the string and printing it the following way:

 BT_receive = Bluetooth.readStringUntil('\n');
lcd.print(BT_receive);

But when I print it on my lcd, it says "Hello\n". How could I receive the string without the \n or modify the string so the \n is not there?

Thanks!

If you insist on pissing away resources using the String class, YOU need to RTFM, and discover there there is a method to trim() stuff.

You need to post a complete program so we can see how variables are defined.

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

...R