You may have to strip out the spaces in the @ipaddress0 macro to use that function

$ipaddress = join(split(@ipaddress0," "),"")