query
On this page

removeSuffix

lib.removeSuffix

Docs pulled from | This Revision | 12 minutes ago


Return a string without the specified suffix, if the suffix matches.

Inputs

suffix

Suffix to remove if it matches

str

Input string

Type

string -> string -> string

Examples

removeSuffix usage example

removeSuffix "front" "homefront"
=> "home"
removeSuffix "xxx" "homefront"
=> "homefront"
(lib.strings.removeSuffix)

Noogle also knows

Aliases