Mid()

Extracts a substring from a string.

Mid( string=string, start=number, count=number );

Returns: String

Argument Description Default
string
string, required

Must be single-quotation mark or double-quotation mark delimited.

start
number, required

The position of the first character to retrieve.

count
number, optional

The number of characters to retrieve. If not set, all characters until the end of the string will be returned.

-1

Examples

str="I Love Lucee server";
writeOutput(mid(str,8,5));

//Member function str="Hi buddy, Nice day!"; writeDump(str.mid(4,5));

See also