Function Reference


StringRight

Returns a number of characters from the right-hand side of a string.

StringRight ( "string", count )

Parameters

string The string to evaluate.
count The number of characters to get.

Return Value

Returns a string containing the rightmost count characters of the string.

Remarks

If count exceeds string length, the entire string is returned.
If count is negative, an empty string is returned.

Related

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

Example

#include <MsgBoxConstants.au3>

Local $sString = StringRight("This is a sentence with whitespace.", 5) ; Retrieve 5 characters from the right of the string.
MsgBox($MB_SYSTEMMODAL, "", "The 5 rightmost characters are: " & $sString)