Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

string.includes()

Test if a String includes a provided substring.

Signature

includes(pattern: String) => Boolean

Description

Tests if the calling String contains a provided substring.

Parameters

Parameter Type Required Description

pattern

String

true

Substring to search for in this String.

Return value

Type Description

Boolean

If true, the calling String contains the provided substring. Otherwise, false.

Examples

  1. Test if the calling string includes the String 200:

    "HTTP/1.1 200 OK".includes("200")
    true
  2. Test if the calling string includes the String 400:

    "HTTP/1.1 200 OK".includes("400")
    false

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!