--- title: "Liquid filters: replace_first" description: Replaces the first instance of a substring inside a string with a given string. api_name: liquid source_url: html: https://shopify.dev/docs/api/liquid/filters/replace_first md: https://shopify.dev/docs/api/liquid/filters/replace_first.md --- # replace\_​first ```oobleck string | replace_first: string, string ``` returns [string](https://shopify.dev/docs/api/liquid/basics#string) Replaces the first instance of a substring inside a string with a given string. ```liquid {{ product.handle | replace_first: '-', ' ' }} ``` ## Output ```html komodo dragon-scale ```