Simple question about strings and concatenate them

Hi.

I want to write the water and outdoor temperature with units on a LCD Screen

I am not quite sure how to concatenate all of this.

I tried:

lcd.print("W:" +  Fahrenheit(waterTemp) + "F O:" + outdoorTemp + "F");

I also tried

String line1 = "W:" & Fahrenheit(waterTemp) + "F O:" + outdoorTemp + "F";
lcd.print(line1);

But all fails

Do I really need to enter everything line by line???

Thanks!

Do I really need to enter everything line by line?

Is that a problem?

I was going to suggest sprintf, but it doesn't support floats.

Not really a problem but quite ugly, having maybe 10 lines instead on 1

String line1 = "W:";
  line1 += Fahrenheit(waterTemp);
  line1 += "F O:"
  line1 += outdoorTemp;
  line1 += "F":

???

It's not hard.

lcd.print("W: "); lcd.print(Fahrenheit(waterTemp)); lcd.print(" F O: "); lcd.print(outdoorTemp); lcd.print( "F");

quite ugly

String?
Yes, I agree. Horrid.

There's dtostrf

Ok, Thanks!