hugo/docs/content/en/functions/strings/TrimPrefix.md

25 lines
666 B
Markdown
Raw Permalink Normal View History

---
title: strings.TrimPrefix
description: Returns the given string, removing the prefix from the beginning of the string.
categories: []
keywords: []
action:
aliases: []
related:
- functions/strings/Chomp
- functions/strings/Trim
Squashed 'docs/' changes from ccb1b97cb..159c843fd 159c843fd Fix front matter menu entry example c3a476a19 Document soft deprecation of PAGE.Scratch cdead9785 netlify: Hugo 0.138.0 9169b4da4 Update version references 3bc6bf431 Update embedded.md 5c7743b2e Update creation instructions for the emoji quick reference 109efe3eb Document the comment shortcode 83d7d3005 Update theme d3c205054 netlify: Hugo 0.137.1 545290351 Handle inline HTML content 0204be97d Update theme 18d09235e Remove JS and CSS that prevents FOUC with client side math rendering 63d9dd876 Update RenderShortcodes.md 064b95539 Update output-format-definition.md 3744f3be2 Describe and refer to the extended/deploy edition 3d3302308 netlify: Hugo 0.137.0 b53aedcea Update RenderShortcodes.md b5f289165 Replace HTML comments in markdown with the new comment shortcode c673880b6 Remove superfluous right bracket f80b0c61e Update faq.md 2ede707eb Document installation on NixOS 09b114914 Update theme 76a9f90b2 Update passthrough.md 9f3355630 Update Scratch.md bc080ecaa Update Store.md 1507ede32 Update Scratch.md 54a90f569 Update Store.md 7c9145c43 Fix broken link dd15f183b Update ToMath.md 2b021c34b Move the [build] documentation to its own page cbb6677ec Fix typo ac0969063 Update ToMath.md 7fbdfd7c8 netlify: Hugo 0.136.5 17f54223c Update ToMath.md 4c9c3bb06 Update multilingual.md 1432da7bd Make site and page language methods linkable fd5b746cb Update urls.md a746f1b3a Update urls.md abf8738e2 netlify: Hugo 0.136.4 bd8759996 Update TrimSpace.md 6103c1e84 Documents strings.TrimSpace 533dd3a7b netlify: Hugo 0.136.3 30f3f97cf Update quick-start.md b0d7b41a0 Update configuration-markup.md 760e5e4f0 Update quick-start.md 17daeb866 Update quick-start.md 1e158e723 netlify: Hugo 0.136.2 d32530839 Update theme edb9bee02 Update description of url front matter field e1c576e18 netlify: Hugo 0.136.1 1ad28e1e0 Describe how to configure uglyURLs per section cbbd4c4fe netlify: Hugo 0.136.0 bb7f35e99 Merge branch 'tempv0.136.0' 706110736 docs: Regen CLI docs bf0c7821f Update urls.md 8c544e6c0 Update quick-start.md 8d02733d0 Update Paginator.md a45327aac Update Paginate.md 1377ed4de Clarify date parsing e19fb8043 Document front matter date field aliases a39951847 Update Tailwind CSS installation instructions 3be164c35 Remove duplicate token 05fc815f7 commands: Add "hugo build" as an alias for "hugo" cb3cb504c Update table render hook example efbee0bff Clarify resources.GetRemote 404 handling 4312d49c9 Update compare.Conditional documentation 4a46d53b6 Update theme 93e542d4f netlify: Hugo 0.135.0 b4da1c104 Remvoe some old new-in shortcodes 4c316f051 Update TailwindCSS.md c2fe91509 Update introduction.md 906b7c66b Update configuration.md 5ab6b3cdd Update documentation.md 26fb4bb4c Update documentation.md e9e917f37 Update version refs 83ce07f24 netlify: Hugo 0.134.3 8cb32f802 Update front-matter.md 94d7f576a Update faq.md fafc1d8d9 netlify: Hugo 0.134.2 bfe9cdc3d Update content-adapters.md 9e49ae3e1 Document ignoreLogs configuration setting 6b47a1d57 Update configuration.md fd98a0372 Document CLI options that can be set in configuration 07c2400d8 Document alternative to Summary method d053fa163 Update to reflect changes in v0.134.1 137dc3241 Update ContentWithoutSummary.md e8f6427d9 netlify: Hugo 0.134.1 git-subtree-dir: docs git-subtree-split: 159c843fd79e94a0f49bee74c272cd0cc4a848a2
2024-11-13 05:07:57 -05:00
- functions/strings/TrimSpace
- functions/strings/TrimLeft
- functions/strings/TrimRight
- functions/strings/TrimSuffix
returnType: string
signatures: [strings.TrimPrefix PREFIX STRING]
aliases: [/functions/strings.trimprefix]
---
```go-html-template
{{ strings.TrimPrefix "a" "aabbaa" }} → abbaa
{{ strings.TrimPrefix "aa" "aabbaa" }} → bbaa
{{ strings.TrimPrefix "aaa" "aabbaa" }} → aabbaa
```