Open In App

SAS | COMPRESS Function with Examples

COMPRESS function is basically used to compress/removes all the spaces/blanks in a character string. In other words, it removes leading, between and trailing spaces from the strings.

The COMPRESS function allows null arguments. A null argument is treated as a string that features a length of zero.



Example:

Input: " Geeks For Geeks "
Output: "Geeksforgeeks"

Input: null
Output: null

Syntax:



COMPRESS(String, characters to be removed, Modifier)

Program:


Article Tags :