IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#56244 - 08/23/18 01:06 PM Ignore a particular Line Break
Greg0818 Offline
OL Newbie

Registered: 08/23/18
Posts: 1
Hi

I have a variable address which contains a Postcode. e. AB12 3LE
The address is in one line, which wraps in a text box.

Eg.
123 Sample Street, Sample, Sampleshire, SA12 3LE

I am happy that it lines breaks after each Comma, but it also sometimes line breaks at the space in the postcode.

So i can get
123 Sample Street, Sample, Sampleshire, SA12
3LE

Is there a way to ignore the line break in the postcode, so i will only ever get

123 Sample Street, Sample, Sampleshire,
SA12 3LE


Thanks

Top
#56251 - 08/27/18 08:40 AM Re: Ignore a particular Line Break [Re: Greg0818]
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 207
Loc: Objectif Lune NL
Use the REPLACE function to replace regular spaces by non-breaking spaces, i.e. CHR(160). If you want to line break after a comma but nowhere else, you could do:

Code:
REPLACE(REPLACE(REPLACE([Address], ", ", ",-"), " ", CHR(160)), ",-", ", ")


This temporarily replaces all occurrences of ", " by ",-", before replacing all occurrences of " " by CHR(160).

Top