Filter on Substrings, Prefixes, and Suffixes

Use contains() to Filter on Substrings

The contains(field, 'value') function checks whether a field’s value contains the given substring.

const ast = parse(tokenize("contains(description, 'free')"));

Use startswith() to Filter on Prefixes

The startswith(field, 'value') function checks whether a field’s value begins with the given prefix.

const ast = parse(tokenize("startswith(name, 'Eliz')"));

Use endswith() to Filter on Suffixes

The endswith(field, 'value') function checks whether a field’s value ends with the given suffix.

const ast = parse(tokenize("endswith(email, '@example.com')"));

Use trim() to Strip Whitespace

The trim(field) function strips leading and trailing whitespace from a field’s value before comparing it.

const ast = parse(tokenize("trim(CompanyName) eq 'Alfreds Futterkiste'"));

Copyright © 2026 The OData Filter Authors.