01). If you need to remove only leading and trailing white space use this:
var address = " No.255 Colombo "
address.replace(/^[ ]+|[ ]+$/g,'');
this will return string "No.255 Colombo"
02). If you need to remove all the white space use this:
var address = " No.255 Colombo "
address.replace(/\s/g,"");
this will return string "No.255Colombo"