create string for serial sending

Hello , I'm using INA219 and I want to send the data using serial in 1 string

is there any what to do it like in c# or java?

string SendData = (voltage + "1" + current);

so in the end it will send(example)

 3.3!0.5

the voltage \ current are float - so do I need to convert them first to string?

Thanks ,

david1234: I want to send the data using serial in 1 string

Why?

Just do this:

Serial.print(voltage);
Serial.print('1');
Serial.println(current);

david1234: is there any what to do it like in c# or java?

string SendData = (voltage + "1" + current);

You can do that with String, but it's recommended not to use String as it is wasteful of memory and can cause your program to crash after some time due to memory fragmentation.

The recommended way to do this is using strings and strcat: http://www.cplusplus.com/reference/cstring/strcat/

you are right ! I thought the after every send it will go to the next line (even if I use print and not println) something the simple is the best :-)

Thank you very much!

You're welcome. I'm glad if I was able to be of assistance. Enjoy! Per