CONTAINS function

  • 21 December 2021
  • 0 replies
  • 971 views

Userlevel 4
Badge +6
  • Community Manager
  • 20 replies

​​Description

Determines if a Text is included within another Text.

 

Syntax

CONTAINS(Text to Find, Text to Search [, Starting Position to Search] [, Is Case Sensitive])

 

Arguments

Argument Type Dimensions Description

Text to Find

(required)

Text Any Dimensions Text to find in the searched Text.

Text to Search

(required)

Text No Dimension or Dimensions of Text to Find Text to search in.

Starting Position to Search

(optional)
Integer No Dimension or Dimensions of Text to Find Position of the character to start the search in, in Text to Search

Is Case Sensitive

(optional)

Boolean No Dimension or Dimensions of Text to Find Whether the search is done with case sensitivity. By default, the search is not case sensitive.

 

Returns

Type Dimensions
Boolean Dimensions of Text to Find

 

TRUE if Text to Find is in Text to Search.

FALSE if Text to Find is not present in Text to Search.

BLANK if Starting Position to Search is a negative value or 0.

 

Examples

Formula Result Description
CONTAINS(“a”, “abc”) TRUE The Text “a” is present in “abc”.
CONTAINS(“c”, “abc”) TRUE The Text “c” is present in “abc”.
CONTAINS(“A”, “abc”) TRUE The search is not case sensitive by default. Finding the Text “A” is equivalent to finding the Text “a”.
CONTAINS(“A”, “abc", 1, TRUE)

FALSE

The search is case sensitive. “A” is not present in “abc”.
CONTAINS(“a”, “abc”, 2) FALSE The Starting Position to Search is set to 2. The searches the Text “a” from the Text “bc”.
CONTAINS(“a”, “abc”, 0) BLANK The Starting Position to Search, 0, is invalid.
CONTAINS(“a”, “abc”, -1) BLANK The Starting Position to Search, -1, is invalid.

 

See also

Related articles: FIND

 

More of a hands-on learner? 

Talk to your Customer Success Manager about downloading the Functions and Modifiers in Pigment Application into your workspace.  It includes examples of every formula and modifier in Pigment!

 


This topic has been closed for comments