Whatever message this page gives is out now! Go check it out!

Mid

Last update:
May 18, 2026

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

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

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page