startsWith (Function)

Signature: startsWith(s: string, prefix: string) -> bool

Description: True if s begins with prefix.

Parameters

  • s (string): The string to test
  • prefix (string): The prefix to look for

Returns: bool

Example

startsWith("GET /api", "GET ")  // true
startsWith ("GET /api", "GET ")  // true