ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Characters taken into account for punctuation and spaces
  • <ANSI string>.EndsWith and UNICODE
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
Checks whether a character string ends:
  • with a specific character string.
  • with one of the character strings in an array.
Example
String1 is string
String2 is string
String1 = "Specify the action of the procedure"
String2 = "Procedure"
IF String1.EndsWith(String2, ccIgnoreCase) <> 9 THEN
Trace("The Procedure word is not found at the end of the string")
END
Syntax

Checking whether a character string ends with a specified string Hide the details

<Result> = <Initial string>.EndsWith(<Search string> [, <Search options>])
<Result>: Integer
  • Size of the corresponding element in the initial string,
  • 0 if <Initial string> does not end with <Search string>.
<Initial string>: Character string
String to compare.
<Search string>: Character string
String to be compared at the end of <Initial string>.
<Search options>: Optional Integer constant (combination of constants)
Comparison options used to search for the <Search string> in the <Initial string>:
ccIgnoreAccentSearches by comparing strings, ignoring accents.
ccIgnoreCaseSearches by comparing strings, ignoring the case (uppercase/lowercase characters).
ccIgnoreInsideSpaceSearches by comparing strings, ignoring spaces within the strings.
WEBDEV - Server codeAndroidAndroid Widget JavaPHP This constant is not available.
ccIgnorePunctuationAndSpaceSearches by comparing strings, ignoring punctuation and spaces (for more details, see Notes).
ccIgnoreSpaceCompares strings ignoring spaces before and after the strings.
ccNormal
(Default value)
Searches by performing a standard comparison between strings, similar to the '=' operator.

Checking whether a character string ends with one of the strings in an array Hide the details

<Result> = <Initial string>.EndsWith(<Search strings> [, <Search options>])
<Result>: Integer
  • Size of the corresponding element,
  • 0 if <Initial string> does not end with one of the elements in <Search strings>.
<Initial string>: Character string
String to compare.
<Search strings>: Array
Elements to compare at the end of <Initial string>. This parameter can be:
  • an array of character strings (in the following format: ["string1", "string2", "string3"]
  • an "array of character strings" variable.
<Search options>: Optional Integer constant (combination of constants)
Comparison options used to search for the <Search string> in the <Initial string>:
ccIgnoreAccentSearches by comparing strings, ignoring accents.
ccIgnoreCaseSearches by comparing strings, ignoring the case (uppercase/lowercase characters).
ccIgnoreInsideSpaceSearches by comparing strings, ignoring spaces within the strings.
WEBDEV - Server codeAndroidAndroid Widget JavaPHP This constant is not available.
ccIgnorePunctuationAndSpaceSearches by comparing strings, ignoring punctuation and spaces (for more details, see Notes).
ccIgnoreSpaceCompares strings ignoring spaces before and after the strings.
ccNormal
(Default value)
Searches by performing a standard comparison between strings, similar to the '=' operator.
Remarks

Characters taken into account for punctuation and spaces

The characters taken into account for punctuation and spaces are provided by the system. To get the list of these characters, write the following WLanguage code:
s is string
FOR i = 0 TO 255
IF Charact(i) <> StringFormat(Charact(i), ccIgnorePunctuationAndSpace) THEN
 s += Charact(i)
END
END
Info(s)
ToClipboard(s)

<ANSI string>.EndsWith and UNICODE

You have the ability to use ANSI strings, Unicode strings and buffers in the different parameters of the function.
The following conversion rule is used for the Ansi systems (Windows or Linux):
  • If at least one of the strings is a buffer, all the strings are converted to buffers and the operation is performed with buffers.
  • If the first condition is not met and there is at least one Unicode string, all the strings are converted to Unicode and the operation is performed in Unicode (the conversion is performed with the current character set, if necessary).
  • Otherwise, the operation is performed in Ansi.
The conversion rule used for Unicode systems is as follows:
  • If at least one of the strings is a buffer, all the strings are converted to buffers and the operation is performed with buffers.
  • Otherwise, the operation is performed in Unicode.
For more details on UNICODE, see Managing UNICODE.
Reminder: The linguistic parameters used are defined during the call to ChangeCharset.
Business / UI classification: Neutral code
Component: wd300vm.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/07/2024

Send a report | Local help