Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Analytics and Notifications for PI System Explorer (PI Server 2024 R2)

Contains

  • Last UpdatedJan 11, 2023
  • 1 minute read

Determine if first string contains second string and return True or False.

Syntax

Contains(s1, s2 [,caseSensitive])

Arguments

  • s1

    Primary string

  • s2

    Substring searched for in primary string

  • caseSensitive

    Optional: Boolean that indicates whether the search is case sensitive. If False (or omitted), the search is not case sensitive. If True, the search is case sensitive

Returns

True if the primary string (s1) contains the substring (s2) and False otherwise

Exceptions

If either of the first two arguments (s1 or s2) is not a string, the function returns an error value

If the optional third argument (caseSensitive) is not a Boolean, the function returns an error value

Example

  • Contains("What","Hat",True)

    [Returns False]

  • Contains("What","Hat")

    [Returns True]

  • Contains("What","at")

    [Returns True]

  • Contains("hat","what")

    [Returns False]

In This Topic
TitleResults for “How to create a CRG?”Also Available in