--- title: "substring-before()" slug: "string-substring-before" updated: 2026-08-17T08:38:53Z published: 2026-08-17T08:38:53Z canonical: "docs.lobstersoftware.com/string-substring-before" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # substring-before() This function returns the partial text of text **a** that lies before the occurrence of search text **b**. ## Parameters | Parameter | Description | | --- | --- | | a | Text. | | b | Search text. | | c | (optional) If *true*, then **a** and **b** are treated case-insensitive, if *false* they are not. Default: *false*. | ## Examples | Parameter a | Parameter b | Parameter c | Result | | --- | --- | --- | --- | | abcdef | def | | abc | | abcdef | x | | |