Left

Description

Returns up to the leftmost count characters in a string.

Returns

String; up to the first count characters in the string parameter.

Category

String functions

Function syntax

Left(string, count)

History

  • ColdFusion (2018 release): Added support for the negative count.

See also

RightMidLen

Parameters

Parameter

Description

string

A string or a variable that contains a string.

count

A positive integer or a variable that contains one. Maximum number of characters to return.

Example

<cfscript>
       myString=Left("That's one small step for man, one giant leap for mankind.",25);
       WriteOutput(myString);
</cfscript>

Output

That's one small step for

 Adobe

Get help faster and easier

New user?