--- title: "remove leading and/or trailing characters()" slug: "basic-remove-leading-trailing-characters" updated: 2026-08-12T08:11:49Z published: 2026-08-12T08:11:49Z canonical: "docs.lobstersoftware.com/basic-remove-leading-trailing-characters" --- > ## 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. # remove leading and/or trailing characters() This function can be used to remove a leading and trailing character sequence **b** from string **a**. ## Parameters | Parameter | Description | | --- | --- | | a | The string to be processed. | | b | The character sequence to be removed. | | c | The processing mode. Allowed values: "leading", "trailing", "both". | ## Examples | Parameter a | Parameter b | Parameter c | Result | | --- | --- | --- | --- | | aaXXXaaa | a | leading | XXXaaa | | baaXXXaaa | a | leading | baaXXXaaa | | aaXXXaaa | a | trailing | aaXXX | | aaXXXaaa | a | both | XXX |