SQUEEZ: Reducing Multiple Spaces to a Single Space

How to:

The SQUEEZ function reduces multiple contiguous spaces within a character string to a single space. The resulting character string has the same length as the original string but is padded on the right with spaces.


Top of page

x
Syntax: How to Reduce Multiple Spaces to a Single Space
SQUEEZ(length, source_string, output)

where:

length

Integer

Is the number of characters in source_string and output.

source_string

Alphanumeric

Is the character string to squeeze.

output

Alphanumeric



Example: Reducing Multiple Spaces to a Single Space

SQUEEZ reduces multiple spaces in NAME to a single blank and stores the result in a column with the format A30:

SQUEEZ(30, NAME, 'A30')

For MARY         SMITH, the result is MARY SMITH.

For DIANE       JONES, the result is DIANE JONES.

For JOHN     MCCOY, the result is JOHN MCCOY.


iWay Software