Mid()

edit

Extracts a substring from a string.

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

Returns: String

Argument Description Default
string
string, required
edit

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

start
number, required
edit

The position of the first character to retrieve.

count
number, optional
edit

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

-1

Examples

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

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

See also