hi ganeshkumar. there are actually 2 types of "spaces" inside. 1 is the line break you are referring to. the other is something called non-breaking space. that's something you cannot get rid of using TRIM. so either use a formula in column B
=SUBSTITUTE(SUBSTITUTE(A1,CHAR(160),""),CHAR(10),"")

or use CTRL + H to Find & Replace
the Line Space can be typed using CTRL + J
replace with nothing

the non-breaking space can be copied from cell A1. just press F2, select a single space at the end & press CTRL + C to copy. paste inside the Find & Replace Window. again, replace with nothing