In french: Droite
Extracts the right part (i.e., the last characters) from a string or buffer.
In this version, the right part of a buffer cannot be extracted.
// Extract characters
Right("The cuckoo", 6) // Returns "cuckoo"
Right("ABC", 50) // Returns "ABC"
Right(" AZELMA") // Returns "AZELMA"
MyString is string = "Antananarivo - Madagascar"
Right(MyString, 10) // Returns "Madagascar"
Extracting the right part of a character string Hide the details
<Result> = Right(<Initial string> [, <Length>])
<Result>: Character string
- Right part of <Initial string>. Corresponds to <Initial string> if <Length> is greater than the length of <Initial string>.
- EOT if <Length> is negative. A WLanguage error occurs (non-fatal error). To get more details on the error, use ErrorInfo.
<Initial string>: Character string
Character string from which the right part will be extracted. This string is not modified.
<Length>: Optional integer
Number of characters to extract. If this parameter is not specified, <Result> corresponds to <Initial string> without leading spaces.
Right and UNICODE
If the string passed as a parameter is an ANSI string, the result will be an ANSI string.
If the string passed as a parameter is a UNICODE string, the result will be a UNICODE string.
Reminder: In UNICODE, each character occupies two bytes of memory. Therefore, the memory footprint of a UNICODE string is twice the number of characters actually contained in the string.
The fist character in the string is at index 1.
Remark: If the result on an ANSI string is assigned to a UNICODE string (and conversely), the conversion will be implicitly performed.
This page is also available for…