FUNCTION:MID
last edited by
gef
on 03-Oct-2011
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>
SideBar
User Login