github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/language/functions/trimprefix.html.md (about) 1 --- 2 layout: "language" 3 page_title: "trimprefix - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-string-trimprefix" 5 description: |- 6 The trimprefix function removes the specified prefix from the start of a 7 given string. 8 --- 9 10 # `trimprefix` Function 11 12 `trimprefix` removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged. 13 14 ## Examples 15 16 ``` 17 > trimprefix("helloworld", "hello") 18 world 19 ``` 20 21 ``` 22 > trimprefix("helloworld", "cat") 23 helloworld 24 ``` 25 26 ## Related Functions 27 28 * [`trim`](./trim.html) removes characters at the start and end of a string. 29 * [`trimsuffix`](./trimsuffix.html) removes a word from the end of a string. 30 * [`trimspace`](./trimspace.html) removes all types of whitespace from 31 both the start and the end of a string.