FUNCTION:MID

last edited byusericongef on 03-Oct-2011

Contents

mid

Description

Extracts a substring from a string.

Usage Syntax

mid(string string,number start,[number count]): string

Return Information

Return Type
string

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.

Name Type Required Description
string string Yes Must be single-quotation mark or double-quotation mark delimited.
start number Yes The position of the first character to retrieve.
count number No The number of characters to retrieve. If not set, all characters until the end of the string will be returned.

= History

Railo 3.3: The function now allows you to omit the last parameter if you want to receive the rest of the string beginning from start. Here’s an example:

<cfset b = "1234567890">
<cfset a = mid(b, 2, 3)>
<cfdump eval=a>
<cfset a = mid(b, 2)>
<cfdump eval=a>

 
Download in other Formats:
markup Markup | pdf PDF | html HTML | word Word