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

format

Formats a string using standard printf style verbs.

Signature

format(format: string, ...args: any) -> string

Parameters

ParameterTypeRequiredDescription
format, argsstring, anyyesFormat template and values

Return value

Returns the documented result for the function signature.

Example

respond {
  status = 200
  body = { message = format("User %s has %d items in cart", ctx.request.path.name, 4) }
}