"mid" (string::mid)

Returns a string that contains n characters of this string, starting at the specified pos index.

Synopsis

string string.mid(int pos, int n = -1);

Parameters

Parameter Description
pos Start index of the returned sub string.
n Number of characters to return.

Description

Returns a string that contains n characters of this string, starting at the specified pos index.

Returns an empty string if the pos index exceeds the length of the string. If there are less than n characters available in the string starting at the given pos, or if n is -1 (default), the function returns all characters that are available from the specified position.

Assignment

String