getdata1=Serial1.readString(); /// working the variable contains text
then how to do something like this
String getdata1 = (getdata1 && "!OK"); // I need attach after readed text from serial next text
if I resend it as this Serial2.println(getdata1 && "!OK"); I will receive 1 not the text.
How can I get text from the variable getdata1 readed from serial and combine it with another text, then resend it as Ascii text to another serial port?
Then you are going about it all wrong. That approach will get the data into a String, which is NOT the same thing.
then how to do something like this
It makes NO sense to logically AND a String and a string literal.
How can I get text from the variable getdata1 readed from serial and combine it with another text, then resend it as Ascii text to another serial port?
There is ABSOLUTELY NO need to do that. It will not make a damned bit of difference to whatever is on the other end of the serial port if you use TWO Serial.print() calls to send the data, or 12 or 1. So, use 2 to send the 2 pieces of data.