### Class

# Gtk StringFilter

since: 4.0

#### Description [src]

    final class Gtk.StringFilter : Gtk.Filter
    {
      /* No available fields */
    }

`GtkStringFilter` determines whether to include items by comparing strings to a fixed search term.

The strings are obtained from the items by evaluating a `GtkExpression` set with `gtk_string_filter_set_expression()`, and they are compared against a search term set with `gtk_string_filter_set_search()`.

`GtkStringFilter` has several different modes of comparison - it can match the whole string, just a prefix, or any substring. Use `gtk_string_filter_set_match_mode()` choose a mode.

It is also possible to make case-insensitive comparisons, with `gtk_string_filter_set_ignore_case()`.

Available since: 4.0

#### Ancestors

- GtkFilter
- GObject

#### Constructors

###### gtk_string_filter_new

Creates a new string filter.

since: 4.0

#### Instance methods

###### gtk_string_filter_get_expression

Gets the expression that the string filter uses to obtain strings from items.

since: 4.0

###### gtk_string_filter_get_ignore_case

Returns whether the filter ignores case differences.

since: 4.0

###### gtk_string_filter_get_match_mode

Returns the match mode that the filter is using.

since: 4.0

###### gtk_string_filter_get_search

Gets the search term.

since: 4.0

###### gtk_string_filter_set_expression

Sets the expression that the string filter uses to obtain strings from items.

since: 4.0

###### gtk_string_filter_set_ignore_case

Sets whether the filter ignores case differences.

since: 4.0

###### gtk_string_filter_set_match_mode

Sets the match mode for the filter.

since: 4.0

###### gtk_string_filter_set_search

Sets the string to search for.

since: 4.0

##### Methods inherited from GtkFilter (3)

###### gtk_filter_changed

Notifies all users of the filter that it has changed.

since: 4.0

###### gtk_filter_get_strictness

Gets the known strictness of `filters`.

since: 4.0

###### gtk_filter_match

Checks if the given `item` is matched by the filter or not.

since: 4.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gtk.StringFilter:expression

The expression to evaluate on item to get a string to compare with.

since: 4.0

###### Gtk.StringFilter:ignore-case

If matching is case sensitive.

since: 4.0

###### Gtk.StringFilter:match-mode

If exact matches are necessary or if substrings are allowed.

since: 4.0

###### Gtk.StringFilter:search

The search term.

since: 4.0

#### Signals

##### Signals inherited from GtkFilter (1)

###### GtkFilter::changed

Emitted whenever the filter changed.

since: 4.0

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct GtkStringFilterClass {
      GtkFilterClass parent_class;

    }

No description available.

###### Class members

`parent_class: GtkFilterClass`
  No description available.