Skip to Content
🎉 Tickety V3 has now been released! Read more →
PlaceholdersParsersPadding Parser

Padding Parser

The Padding Parser allows you to add padding characters to strings to ensure they reach a specific length. You can specify the length, padding character, and padding direction.

Usage

To use the parser, insert the following syntax in your text:

{padding(length:padChar:direction):text}

  • You can also reference this parser using the alias: pad

Examples

  1. Left padding (default):
  • Input: {pad(4):42}
  • Output: 0042
  1. Custom padding character:
  • Input: {pad(4:*):42}
  • Output: **42
  1. Right padding:
  • Input: {pad(4:0:right):42}
  • Output: 4200
  1. Center padding:
  • Input: {pad(4:-:both):42}
  • Output: -42-

Available Parameters

ParameterDescriptionDefaultExample
lengthTarget length for the string (required)-4
padCharCharacter used for padding”0”*
directionPadding direction: “left”, “right”, or “both""left”right

Notes:

  • If the text is already equal to or longer than the specified length, it will be returned unchanged
  • For “both” (center) padding, if the padding cannot be distributed evenly, the extra padding character will be added to the right side