ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Truncates the right part of a string or buffer. You can specify:
  • the number of characters of the truncated string.
  • the number of characters to be removed.
Example
sString is string = " Turlututu"
 
// Truncate the string to 9 characters
Trace(Truncate(sString, 9)) // Displays " Turlutut"
Trace(Truncate(sString, 9, numberOfCharactersToStore))  // Displays " Turlutut"
 
// Truncate the string to 4 characters
Trace(Truncate(sString, 4, numberOfCharactersToDelete))
// Displays " Turlu"
Syntax
<Result> = Truncate(<Source> , <Number of characters> [, <Truncate method>])
<Result>: Character string
  • Truncated string.
  • EOT if <Number of characters> is negative. A WLanguage error occurs (non-fatal error). To get more details on the error, use ErrorInfo.
<Source>: Character string or Buffer
Element to use: String or buffer. This element is not modified.
<Number of characters>: Integer
Corresponds to:
  • the number of characters that must be kept in the <Result> string (if the numberOfCharactersToStore constant is used).
  • the number of characters or bytes that must be removed from <Source> (if the numberOfCharactersToDelete constant is used).
<Truncate method>: Optional Boolean constant
Truncate method to use:
numberOfCharactersToDelete<Number of characters> corresponds to the number of characters that must be removed from <Source>.
numberOfCharactersToStore
(Default value)
<Number of characters> corresponds to the number of characters that must be kept in the <Result> string.
Business / UI classification: Neutral code
Component: wd290vm.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help