ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Right and UNICODE
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Extracts the last characters from a string or string buffer.
WEBDEV - Browser code In this version, the last characters of a buffer string cannot be extracted.
Example
// 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"
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget JavaUser code (UMC)PHPAjax
// Extract bytes
MyBuffer is Buffer = "Antananarivo - Madagascar"
Right(MyBuffer, 10)  // Returns "Madagascar"
Syntax

Extracting the last characters from a string Hide the details

<Result> = Right(<Initial string> [, <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.
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJavaUser code (UMC)PHPAjax

Extracting the last characters of a string buffer Hide the details

<Result> = Right(<Initial buffer> [, <Length>])
<Result>: Buffer
  • Last characters of <Initial buffer>. Corresponds to <Initial buffer> if <Length> is greater than <Initial buffer>.
  • EOT if <Length> is negative. A WLanguage error occurs (non-fatal error). To get more details on the error, use ErrorInfo.
  • Buffer invalid if <Buffer initial> contains a string in Unicode format.
<Initial buffer>: Buffer
Name of the string buffer from which the last characters will be extracted. This buffer is not modified.
<Length>: Optional integer
Number of bytes to extract. If this parameter is not specified, <Result> corresponds to <Initial buffer> without leading spaces.
Remarks

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 in parameter is in Unicode format, the result will be in Unicode format.
Reminder In Unicode, each character occupies two bytes of memory. The memory size of a Unicode string is therefore twice the number of characters actually contained in the string.
The fist character in the string is at index 1.
Note If the result on an ANSI string is assigned to a Unicode string (and vice versa), the conversion will be implicitly performed.
For more details, see Unicode management.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/17/2024

Send a report | Local help