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
Allows you to check if a substring is within a string.
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 28"

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

Checking if a string contains a substring Hide the details

<Result> = Contains(<String to analyze> , <Substring> [, <Options>])
<Result>: Boolean
  • True if the string contains a substring.
  • False otherwise.
<String to analyze>: ANSI, Unicode or Binary string
Character string to use.
<Substring>: ANSI, Unicode or Binary string
Search substring.
<Options>: Integer constant
Method to search for the substring:
IgnoreCaseCase and accent insensitive search (ignores uppercase/lowercase differences).
WholeWordSearches for a whole word (between punctuation characters or spaces).

By default, the search is case-sensitive and takes into account all specified strings (even if they are part of a word).

Checking if a string contains one of the strings in an array Hide the details

<Result> = Contains(<String to analyze> , <Array of search strings> [, <Options>])
<Result>: Boolean
  • True if the string contains one of the strings in the array.
  • False otherwise.
<String to analyze>: ANSI, Unicode or Binary string
Character string to use.
<Array of search strings>: Array
Name of the array containing the search strings.
<Options>: Integer constant
Method to search for the substring:
IgnoreCaseCase and accent insensitive search (ignores uppercase/lowercase differences).
WholeWordSearches for a whole word (between punctuation characters or spaces).

By default, the search is case-sensitive and takes into account all specified strings (even if they are part of a word).
Component: wd300vm.dll
Minimum version required
  • Version 17
This page is also available for…
Comments
video windev contains
https://youtu.be/m1cKtL-KeoU
amarildo
03 Dec. 2018
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
27 Oct. 2016

Last update: 06/10/2024

Send a report | Local help