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.md.

trim

Removes characters defined in cutset from both ends of a string.

Signature

trim(str: string, cutset: string) -> string

Parameters

ParameterTypeRequiredDescription
str, cutsetstring, stringyesInput string and cutset

Return value

Returns the documented result for the function signature.

Example

respond { status = 200, body = { normalized = trim(ctx.request.query.value, " -") } }