Function Reference


StringLen

Returns the number of characters in a string.

StringLen ( "string" )

Parameters

string The string to evaluate.

Return Value

Returns the length of the string.

Remarks

A numeric expression is automatically evaluated and converted to a string.

Related

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

Example

#include <MsgBoxConstants.au3>

; Retrieve the length of a string.
; If the string is using only ASCII characters, then the length is equal to the size in bytes e.g. 10 characters is 10 bytes.
Local $iLength = StringLen("This is a sentence with whitespace.")
MsgBox($MB_SYSTEMMODAL, "", "The length of this string is " & $iLength & " characters.")