PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Characters taken into account for the punctuation and the spaces
  • StringStartsWith function 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 found in a list.
Versions 16 and later
PHP This function is now available for the PHP sites.
New in version 16
PHP This function is now available for the PHP sites.
PHP This function is now available for the PHP sites.
Versions 17 and later
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
New in version 17
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Versions 18 and later
This function is now available in Android Widget mode.
This function is now available in Windows Store apps mode.
This function is now available for the iPhone/iPad applications.
New in version 18
This function is now available in Android Widget mode.
This function is now available in Windows Store apps mode.
This function is now available for the iPhone/iPad applications.
This function is now available in Android Widget mode.
This function is now available in Windows Store apps mode.
This function is now available for the iPhone/iPad applications.
Versions 20 and later
This function is now available for the Windows Phone applications.
New in version 20
This function is now available for the Windows Phone applications.
This function is now available for the Windows Phone applications.
Versions 21 and later
This function is now available in Apple Watch mode.
This function is now available in Universal Windows 10 App mode.
New in version 21
This function is now available in Apple Watch mode.
This function is now available in Universal Windows 10 App mode.
This function is now available in Apple Watch mode.
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 StringStartsWith(MyResponse, "HTTP/1.0 20") <> 0 THEN
ProcessSuccessResponse(MyResponse)
END
Syntax

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

<Result> = StringStartsWith(<Initial String> , <Sought String> [, <Search Options>])
<Result>: Integer
  • Size of the corresponding element in the initial string,
  • 0 if <Initial String> does not start with <Sought String>.
<Initial String>: Character string (with quotes)
String to compare.
<Sought String>: Character string (with quotes)
String that must be compared to the beginning of <Initial String>.
<Search Options>: Optional Integer constant (combination of constants)
Options used for the search:
ccNormal
(Default value)
Standard comparison, similar to the operator '='.
ccIgnoreAccentComparison while ignoring the accented characters.
ccIgnoreCaseComparison while ignoring the case (uppercase/lowercase characters).
ccIgnoreSpaceComparison while ignoring the space characters found before and after the character strings to compare.
Versions 20 and later
ccIgnoreInsideSpace
New in version 20
ccIgnoreInsideSpace
ccIgnoreInsideSpace
Comparison while ignoring the space characters found inside the character strings to compare.
AndroidJavaPHP This constant is not available.
ccIgnorePonctuationAndSpaceComparison while ignoring the punctuation and the space characters (see the Notes for more details).
Not available in Windows Phone
Not available in Universal Windows 10 App

Checking whether a character string starts with one of the strings found in the list Hide the details

<Result> = StringStartsWith(<Initial String> , <List of Sought Strings> [, <Search Options>])
<Result>: Integer
  • Size of the corresponding element,
  • 0 if <Initial String> does not start with one of the elements of <List of Sought Strings>.
<Initial String>: Character string (with quotes)
String to compare.
<List of Sought Strings>: Character string, array, ...
List of elements that must be compared to the beginning of <Initial String>. This parameter can correspond to:
  • a simple character string,
  • a character string variable,
  • 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)
Options used for the search:
ccNormal
(Default value)
Standard comparison, similar to the operator ='.
ccIgnoreAccentComparison while ignoring the accented characters.
ccIgnoreCaseComparison while ignoring the case (uppercase/lowercase characters)
ccIgnoreSpaceComparison while ignoring the space characters found before and after the character strings to compare
Versions 20 and later
ccIgnoreInsideSpace
New in version 20
ccIgnoreInsideSpace
ccIgnoreInsideSpace
Comparison while ignoring the space characters found inside the character strings to compare.
ccIgnorePonctuationAndSpaceComparison while ignoring the punctuation and the space characters (see the Notes for more details).
Remarks

Characters taken into account for the punctuation and the spaces

The characters taken into account for the punctuation and the spaces are supplied 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)

StringStartsWith function 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):
  • It at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • If the first condition is not fulfilled, if at least one of the strings in in Unicode format, all the strings are converted into 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):
  • It at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • Otherwise, the operation is performed in Unicode.
See Managing the UNICODE format for more details.
Components
WINDEVWEBDEV - Server codeReports and Queries wd0vm.dll
Windows Mobile wp0vm.dll
Java wd0java.jar
Linux wd0vm.so
Android wd0android.jar
Minimum required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment