Formatting multi line addresses with commas

I want this…

The Beach House,
Seaview Road,
Brighton,
BN1 1AA

and not this…

The Beach House,
Seaview Road,
,
Brighton,
,
BN1 1AA

I can start off with this

<td>{{property}}
{{street}}
{{locality}}
{{post_town}}
{{county}}
{{postcode}}</td>

then add commas and line breaks

<td>{{property}},<br>
{{street}},<br>
{{locality}},<br>
{{post_town}},<br>
{{county}},<br>
{{postcode}}</td>

or the same thing within one binding

<td>{{property + ",<br>" + street + ",<br>" + locality + ",<br>" + post_town + ",<br>" + county + ",<br>" + postcode}}</td>

But what about those properties without ‘property’ or ‘locality’ or ‘county’ as above? I don’t want to be left with gaps. Logic tells me to put

IF street exists THEN "street,<br>" ELSE ""

Do I really need to do this for every line? Is there an easy Wappler way to do this?

Community Page
Last updated: