Mid

Description

Extracts a substring from a string.

Returns

A string; the set of characters from string, beginning at start, of length count.

Category

Syntax

Mid(string, start, count)

See also

LeftLenRight

Parameters

Parameter

Description

string

A string or a variable that contains one. Must be single-quotation mark or double-quotation mark delimited.

start

A positive integer or a variable that contains one. Position at which to start count. Positions start with 1, not 0.

count

A positive integer or a variable that contains one. Number of characters to return. (Zero is not valid, but it does not throw an error.)

Example

<cfscript>
       myString="the quick brown fox jumps over the lazy dog";
       WriteOutput(mid(myString,5,11));
</cfscript>

Output

quick brown

 Adobe

Get help faster and easier

New user?