how to print a variable in a 16,2 lcd?

hey guys i have read the temperature from my temp sensor which i want to print on lcd like this:

temperature= xx
(text) (variable)

how to do it?
sould be in the same line

Read up on setCursor.

You need to print the text only once.
The value should be updated each time it changes.

zacmackra:
hey guys i have read the temperature from my temp sensor which i want to print on lcd like this:

temperature= xx
(text) (variable)

how to do it?
sould be in the same line

Do the "temprature=" at 0,0 in setup
In the loop, set cusor to 12
lcd.print(variable);

just like Serial.print(variable), which I assume you have already done.

There are refinements. You may be better off print "temp=" and cursor 11, to allow for two digit floats with minis sign. You may also need to follow positives with a blank space, or arrange a cursor 12 for them.

i want to print on lcd like this:

Any of the 216 or 220 LCD clock projects in the forum will have ample code! Just search.

If you are not very picky, then investigate the <Streaming.h> library.

#include <Streaming.h>
.......
// code here to Position x,y and line0 or line1...
LCD << "Temp: " << temp << "F°" ;

Alternatively, you could go in an modify the Print class to add printf() support to it.
http://playground.arduino.cc/Main/Printf

--- bill