invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

LTRIM

Syntax

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> LTRIM[LTRIM]:::quoted
    ltrim -->| | LTRIM
    LTRIM --> End((END))

Purpose

The LTRIM SQL function trims characters from the left side of a text.

See also TRIM and RTRIM.

Parameters:

  • Input (varchar2): the text from to trim characters from the left side.
  • Characters to trim (optional, varchar2): all character(s) to trim. Defaults to a space.

Returns: A text with characters trimmed from the left.

Examples

The following example trims the leading space from abcd:

select ltrim(' abcd')

-------------------
abcd

The following example trims all characters b, c and a from the left side of abcd:

select ltrim('abcd', 'bca')

-------------------
d

The following example trims all digits from the left side of 1029384756abcd:

select ltrim('1029384756abcd', '0123456789')

-------------------
abcd