TRIM_: Removing Leading Characters, Trailing Characters, or Both From a String

How to:

The TRIM_ function removes all occurrences of a single character from either the beginning or end of a string, or both.


Top of page

x
Syntax: How to Remove Leading Characters, Trailing Characters, or Both From a String
TRIM_(trim_where, trim_character, source_string) 

where:

trim_where

Keyword

Defines where to trim the source string. Valid values are:

  • LEADING, which removes leading occurrences.
  • TRAILING, which removes trailing occurrences.
  • BOTH, which removes leading and trailing occurrences.
trim_character

Alphanumeric

Is a single character, enclosed in single quotation marks ('), whose occurrences are to be removed from source_string. For example, the character can be a single blank (‘ ‘).

source_string

Alphanumeric

Is the string to be trimmed.

The data type of the returned string is AnV.



Example: Trimming a Character From a String

TRIM_ removes leading occurrences of the character ‘B’ from DIRECTOR.

TRIM_(LEADING, 'B', DIRECTOR)

For BROOKS R., the result is ROOKS R.


iWay Software