For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/manifest/functions/strings/trim_prefix.md.

trim_prefix

Removes a prefix from the start of a string if present.

Signature

trim_prefix(str: string, prefix: string) -> string

Parameters

ParameterTypeRequiredDescription
str, prefixstring, stringyesInput string and prefix

Return value

Returns the documented result for the function signature.

Example

args = { token = trim_prefix(ctx.request.headers.authorization, "Bearer ") }