Help / WLanguage / WLanguage functions / Standard functions / String functions
  • <ANSI String type>.Right and UNICODE
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Extracts the last characters from a string.
// Extract characters
MyString is string
MyString = "The cuckoo"
MyString.Right(6)   // Returns "cuckoo"
MyString = "ABC"
MyString.Right(50)   // Returns "ABC"
MyString = " AZELMA"
MyString.Right()   // Returns "AZELMA"
MyString is string = "Antananarivo - Madagascar"
MyString.Right(10) // Returns "Madagascar"

Extracting the right part of a character string Hide the details

<Result> = <Initial string>.Right([<Length>])
<Result>: Character string
  • Last characters 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
String from which the last characters 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.

<ANSI String type>.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 uses two bytes.. Therefore, the memory size of 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.
For more details, see Managing UNICODE.
Component: wd290vm.dll
Minimum version required
  • Version 28
This page is also available for…
Click [Add] to post a comment

Last update: 04/24/2023

Send a report | Local help