ltrim() / rtrim()

Purpose

ltrim

ltrim(str)

Removes any spaces at the start of a given string. Input is a string, output is the same string starting with the first non-space character.

rtrim

rtrim(str)

Removes any spaces at the end of a given string. Input is a string, output is the same string ending with the last non-space character.

Example

ltrim

In the following example the spaces at the beginning of the string are removed.

ltrim("   str ")

produces

"str "

rtrim

In the following example the spaces at the end of the string are removed.

rtrim("   str ")

produces

"   str"

See also

Help with configuring/using Rsyslog:

See also

Contributing to Rsyslog:

Copyright 2008-2023 Rainer Gerhards (Großrinderfeld), and Others.