Function Reference


StringMid

Extracts a number of characters from a string.

StringMid ( "string", start [, count = -1] )

Parameters

string The string to evaluate.
start The character position to start. (1 = first character)
count [optional] The number of characters to extract. By default the entire remainder of the string.

Return Value

Returns the extracted string.

Remarks

If start is out-of-bounds, an empty string is returned. If start is valid but count is out-of-bounds, the entire remainder of the string is returned.

Related

StringCompare, StringInStr, StringLeft, StringLen, StringLower, StringReplace, StringRight, StringSplit, StringTrimLeft, StringTrimRight, StringUpper

Example

#include <MsgBoxConstants.au3>

; Retrieve 5 characters from the 10th position in the string.
Local $sString = StringMid("This is a sentence with whitespace.", 10, 5)
MsgBox($MB_SYSTEMMODAL, "", $sString)