diff --git a/content/en/functions/hasPrefix.md b/content/en/functions/hasPrefix.md deleted file mode 100644 index 37a15deed..000000000 --- a/content/en/functions/hasPrefix.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: hasprefix -description: Tests whether a string begins with prefix. -categories: [functions] -menu: - docs: - parent: functions -keywords: [strings] -signature: ["hasPrefix STRING PREFIX"] -relatedfuncs: [hasSuffix] ---- - -* `{{ hasPrefix "Hugo" "Hu" }}` → true diff --git a/content/en/functions/hasSuffix.md b/content/en/functions/hasSuffix.md deleted file mode 100644 index 994a3a572..000000000 --- a/content/en/functions/hasSuffix.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: hasSuffix -description: Tests whether a string ends with suffix. -categories: [functions] -menu: -docs: -parent: functions -keywords: [strings] -signature: ["hasSuffix STRING SUFFIX"] -relatedfuncs: [hasPrefix] ---- - -* `{{ hasSuffix "Hugo" "go" }}` → true diff --git a/content/en/functions/strings.HasPrefix.md b/content/en/functions/strings.HasPrefix.md new file mode 100644 index 000000000..70317a4c1 --- /dev/null +++ b/content/en/functions/strings.HasPrefix.md @@ -0,0 +1,16 @@ +--- +title: strings.HasPrefix +description: Tests whether a string begins with prefix. +categories: [functions] +menu: + docs: + parent: functions +keywords: [strings] +signature: ["hasPrefix STRING PREFIX","strings.HasPrefix STRING PREFIX"] +relatedfuncs: [hasSuffix] +aliases: [/functions/hasprefix/] +--- + +```go-html-template +{{ hasPrefix "Hugo" "Hu" }} → true +``` diff --git a/content/en/functions/strings.HasSuffix.md b/content/en/functions/strings.HasSuffix.md index 086cac548..3ead121a3 100644 --- a/content/en/functions/strings.HasSuffix.md +++ b/content/en/functions/strings.HasSuffix.md @@ -1,15 +1,16 @@ --- title: strings.HasSuffix -description: Determine whether a given string ends with the provided trailing suffix string. +description: Tests whether a string ends with suffix. categories: [functions] menu: docs: parent: functions keywords: [strings] -signature: ["strings.HasSuffix STRING SUFFIX"] +signature: ["hasSuffix STRING SUFFIX","strings.HasSuffix STRING SUFFIX"] relatedfuncs: [hasPrefix] +aliases: [/functions/hassuffix/] --- - {{ $pdfPath := "/path/to/some.pdf" }} - {{ strings.HasSuffix $pdfPath "pdf" }} → true - {{ strings.HasSuffix $pdfPath "txt" }} → false +```go-html-template +{{ hasSuffix "Hugo" "go" }} → true +```