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.startsWith()

Test if a String starts with a provided prefix.

Signature

startsWith(prefix: String) => Boolean

Description

Tests if the calling String starts with a provided prefix.

Parameters

Parameter Type Required Description

prefix

String

true

Prefix to compare to the end of the calling String.

Return value

Type Description

Boolean

If true, the calling String ends with the prefix. Otherwise, false.

Examples

  1. Test whether a String starts with HTTP:

    "HTTP/1.1 200 OK".startsWith("HTTP")
    true
  2. Test whether a String starts with 200:

    "HTTP/1.1 200 OK".startsWith("200")
    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!