Learn

starts_with

Returns true if the string begins with a specific value, false otherwise.

Sample Usage

---
title: The Forest
---

{{ title|starts_with:the }}

This will return true.

Note: the v1 modifier parser does not accept whitespace.

Parameters

You can pass a true/false flag to enable case sensitivity. By default it is case-insensitive.

---
title: The Forest
---

{{ title|starts_with:the:true }}

This will return false because “forest” does not match “Forest” when case-sensitive.

This article was last updated on March 30th, 2016. Find an error? Please let us know!