### Function

# GLib str_equal

since: 2.0

#### Declaration

    gboolean
    g_str_equal (
      gconstpointer v1,
      gconstpointer v2
    )

#### Description

Compares two strings for byte-by-byte equality and returns `TRUE` if they are equal. It can be passed to `g_hash_table_new()` as the `key_equal_func` parameter, when using non-`NULL` strings as keys in a `GHashTable`.

This function is typically used for hash table comparisons, but can be used for general purpose comparisons of non-`NULL` strings. For a `NULL`-safe string comparison function, see g_strcmp0().

Available since: 2.0

#### Parameters

`v1`

  Type: `gconstpointer`

  A key.

  The data is owned by the caller of the function.

`v2`

  Type: `gconstpointer`

  A key to compare with `v1`

  The data is owned by the caller of the function.

#### Return value

Type: `gboolean`

`TRUE` if the two keys match.