PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Used to find out whether a sub-string is included in a string.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Stored procedures This function is now available in the code of stored procedures.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Stored procedures This function is now available in the code of stored procedures.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Stored procedures This function is now available in the code of stored procedures.
Versions 19 and later
WEBDEV - Browser code This function is now available in Browser code.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
New in version 19
WEBDEV - Browser code This function is now available in Browser code.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
WEBDEV - Browser code This function is now available in Browser code.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Versions 20 and later
PHP This function is now available for the PHP sites.
New in version 20
PHP This function is now available for the PHP sites.
PHP This function is now available for the PHP sites.
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
sMyString is string = "Antananarivo"
IF Contains(sMyString, "NA") = False THEN
Info("This string does not contain the NA syllabus")
END
arrString is array of strings = ["WINDEV","WEBDEV"]
sTest is string = "WEBDEV 22"

IF Contains(sTest, arrString) THEN
Info("This string contains WINDEV or WEBDEV")
END
Syntax

Finding out whether a string contains a sub-string Hide the details

<Result> = Contains(<String to Analyze> , <Sub-string> [, <Options>])
<Result>: Boolean
  • True if the string contains the sub-string.
  • False otherwise.
<String to Analyze>: Character string in Ansi, Unicode or Binary format (with quotes)
Character string to use.
<Sub-string>: Character string in Ansi, Unicode or Binary format (with quotes)
Sub-string to find.
<Options>: Integer constant
Mode used to find the sub-string:
WholeWordSearch for a whole word (enclosed in punctuation characters or in space characters).
IgnoreCaseSearch while ignoring the case (uppercase/lowercase characters) or the accented characters.
By default, the search is case sensitive and it searches for all the specified strings (even if they are part of a word).

Finding out whether a string contains one of the strings found in an array Hide the details

<Result> = Contains(<String to Analyze> , <Array of Strings to Find> [, <Options>])
<Result>: Boolean
  • True if the string contains one of the strings found in the array.
  • False otherwise.
<String to Analyze>: Character string in Ansi, Unicode or Binary format (with quotes)
Character string to use.
<Array of Strings to Find>: Array
Name of the array containing the character strings that must be found.
<Options>: Integer constant
Mode used to find the sub-string:
WholeWordSearch for a whole word (enclosed in punctuation characters or in space characters).
IgnoreCaseSearch while ignoring the case (uppercase/lowercase characters) or the accented characters.
By default, the search is case sensitive and it searches for all the specified strings (even if they are part of a word).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 17
This page is also available for…
Comments
Exemplo Contains
IF Contains(EDT_Texto,EDT_Procura) = True THEN
Info("Existe no Texto")
ELSE
Info("Nao Existe no Texto")
END

// Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/10/aula-952-windev-string-25-contains.html

https://www.youtube.com/watch?v=JzqoACpaxDI

De matos
Oct. 27 2016