Function Reference


Extracts a number of characters from a string.

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


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.


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.


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


#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)