TRIM_: Removing a Leading Character, Trailing Character, 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.

Note:


Top of page

x
Syntax: How to Remove a Leading Character, Trailing Character, or Both From a String
TRIM_(where, pattern, string) 

where:

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.
pattern

Alphanumeric

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

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