613-518-1166 info@zimdatabases.com

ZIM Language Reference

$left

< All Topics

$left

Extracts a segment from the front of a character string.

Syntax

$left(source,length)

Parameters

source

a character string or an expression that evaluates to a character string

length

a number or an expression that evaluates to a number

Return Value

Character string, consisting of a string containing length characters from source, starting in the first position.

Comments

Use $left to produce a string consisting of length characters from source, starting in the first position.

If source is not of a character data type, it is converted to a character data type before processing.

If length is zero or negative, the result is the null string. If length is longer than source, the result is source.

Example

$left(“abcdefgh”,5)

Evaluates to “abcde”.

$left(9999,1)

Evaluates to ” “, because numbers are converted to character strings containing seventeen characters before being processed by $left.

$left(1234567890,10)

Evaluates to ” 123″. Number literals convert to character strings containing seventeen characters before being processed by $left.

 

See Also

$concat

$delete

$insert

$position

$replace

$right

$substring

$toalpha

$tocharacter

$translate

About Character Literals

About Functional Expressions

Conversion Between Data Types

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents