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)

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

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy