DataBasic Reference > MultiValue Compatibility > Statements and Intrinsic Functions > LEFT Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

LEFT Function (DataBasic MultiValue Compatibility) (m6187ai+left_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

LEFT Function

Returns the specified number of characters from the beginning of a string.

This function is provided for compatibility with other MultiValue systems.

Syntax

LEFT(string, charCount)

Syntax Elements

string A DataBasic expression that evaluates to a string.

charCount A DataBasic expression that evaluates to the number of characters to extract. Only the integer part is used.

If negative, one less than the specified number of characters are removed from the end of the string and LEFT returns what remains.

Return Value

A string containing the specified number of characters from the beginning of the string.

Operation

The LEFT function is equivalent to the following substring extraction operation:

string[1, charCount]

See Also

RIGHT function, Substring Extraction.

Examples

S = "123456789"
C = 7
R = LEFT(S, C)

Sets R to "1234567".

S = "123456789"
C = -7
R = LEFT(S, C)

Sets R to "123".

S = "123456789"
C = 12
R = LEFT(S, C)

Sets R to "123456789" (C is greater than the length of the string, so the complete string is returned).

RealityV15.0Comment on this topic