PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Characters taken into account for punctuation and spaces
  • <String type>.StartsWith and UNICODE
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Checks whether a character string starts:
  • with a specific character string.
  • with one of the character strings in an array.
Versions 16 and later
PHP This function is now available for PHP sites.
New in version 16
PHP This function is now available for PHP sites.
PHP This function is now available for PHP sites.
Versions 17 and later
Android This function is now available for Android applications.
Java This function is now available for Java applications.
New in version 17
Android This function is now available for Android applications.
Java This function is now available for Java applications.
Android This function is now available for Android applications.
Java This function is now available for Java applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 18
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Checks whether the response received from a Web server corresponds to a known response
MyResponse is string
MyResponse = HTTPGetResult()
IF MyResponse.StartsWith("HTTP/1.0 20") <> 0 THEN
ProcessSuccessResponse(MyResponse)
END
Syntax

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

<Result> = <Initial string>.StartsWith(<Search string> [, <Search options>])
<Result>: Integer
  • Size of the corresponding element in the initial string,
  • 0 if <Initial string> does not start with <Search string>.
<Initial string>: Character string
Text in which the first characters must be checked.
<Search string>: Character string (with quotes)
Text to be searched at the beginning of <Initial string>.
<Search options>: Optional Integer constant (combination of constants)
Comparison options used to search for the <Search string> in the <Initial string>:
ccNormal
(Default value)
Searches by performing a standard comparison between strings, similar to the '=' operator.
ccIgnoreAccentSearches by comparing strings, ignoring accents.
ccIgnoreCaseSearches by comparing strings, ignoring the case (uppercase/lowercase characters).
ccIgnoreSpaceCompares strings ignoring spaces before and after the strings.
Versions 20 and later
ccIgnoreInsideSpace
New in version 20
ccIgnoreInsideSpace
ccIgnoreInsideSpace
Searches by comparing strings, ignoring spaces within the strings.
AndroidAndroid Widget JavaPHP This constant is not available.
ccIgnorePunctuationAndSpaceSearches by comparing strings, ignoring punctuation and spaces (see Notes for more details).
Universal Windows 10 App

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

<Result> = <Initial string>.StartsWith(<Search strings> [, <Search options>])
<Result>: Integer
  • Size of the corresponding element in the initial string,
  • 0 if <Initial string> does not start with one of the elements in <Search strings>.
<Initial string>: Character string
Text in which the first characters must be checked.
<Search strings>: Array
Elements to be searched at the beginning of <Initial string>. This parameter can correspond to:
  • 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>:
ccNormal
(Default value)
Searches by performing a standard comparison between strings, similar to the '=' operator.
ccIgnoreAccentSearches by comparing strings, ignoring accents.
ccIgnoreCaseSearches by comparing strings, ignoring the case (uppercase/lowercase characters).
ccIgnoreSpaceCompares strings ignoring spaces before and after the strings.
Versions 20 and later
ccIgnoreInsideSpace
New in version 20
ccIgnoreInsideSpace
ccIgnoreInsideSpace
Searches by comparing strings, ignoring spaces within the strings.
AndroidAndroid Widget JavaPHP This constant is not available.
ccIgnorePunctuationAndSpaceSearches by comparing strings, ignoring punctuation and spaces (see Notes for more details).
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)

<String type>.StartsWith 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 following conversion rule is used for the Unicode systems (Windows CE):
  • 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: wd260vm.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment