function

ltrim . string . sncode

VERSIONlatest Eliminates whitespace from the beginning of a string.

LTRIM

NAME

ltrim - Eliminates whitespace from the beginning of a string.

SYNOPSIS

ltrim(str,charlist)

DESCRIPTION

This function is used to eliminate characters (from a defined set) from the left side of a string. Without the second parameter, characters from these groups will be trimmed:

  • " " (ASCII 32 (0x20)), an ordinary space.
  • "\t" (ASCII 9 (0x09)), a tab.
  • "\n" (ASCII 10 (0x0A)), a new line (line feed).
  • "\r" (ASCII 13 (0x0D)), a carriage return.
  • "\x0B" (ASCII 11 (0x0B)), a vertical tab.

It will return the string without the characters that were eliminated.

PARAMETERS

str
The string that will be trimmed. charlist This is optional. The characters that are going to be trimmed can be specified using this parameter. The user only has to list all characters that have to be eliminated. With "..", one can specify a range in which the character to be trimmed could be. For example, if one says ltrim(charlist:"x0..9,x0x89"), it will trim all the x from the string.

RETURN

string
The trimmed string.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

in: res={_{ltrim("   caroline")}}
out:res=caroline

in: res={_{ltrim(charlist:"o0..9","o0aaa098")}}
out: res=0aaa098

in: res={_{ltrim(charlist:"o0..9","o0aaao098")}}
out: res=0aaa098

in: res={_{ltrim(charlist:"o0..9","o0aaa98o")}}
out: res= 0aaa98o

The last o is not trimmed since it is out of the range.

in:  res={_{ltrim(charlist:"ò0..9","òóaaaÓ098")}}.
out: res=óaaaÓ098.

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>