Merge pull request #25339 from jessica-ritter/patch-1

Trimprefix: what happens when prefix is not in string?
This commit is contained in:
Alisdair McDiarmid 2020-06-24 10:25:30 -04:00 committed by GitHub
commit 377b99907b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -13,7 +13,7 @@ description: |-
earlier, see earlier, see
[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html).
`trimprefix` removes the specified prefix from the start of the given string. `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.
## Examples ## Examples
@ -22,6 +22,11 @@ earlier, see
world world
``` ```
```
> trimprefix("helloworld", "cat")
helloworld
```
## Related Functions ## Related Functions
* [`trim`](./trim.html) removes characters at the start and end of a string. * [`trim`](./trim.html) removes characters at the start and end of a string.