string::starts_with

Return whether the string begins with a string.

Synopsis

bool
starts_with(
    string_view s) const noexcept; (1)

bool
starts_with(
    char ch) const noexcept; (2)

Description

Returns true if the string begins with s, and false otherwise.

Complexity

Linear.

Parameters

Name Description

s

The string_view to check for.

ch

The character to check for.