padding API v1

Left padding

Pads a string by inserting characters on the left side.

Endpoint:

GET https://api.clsr.net/padding/v1/left

GET parameters:

  • str: string – string to pad
  • len: integer – requested padded minimum string length, maximum value 16384
  • ch: character – a single character to be used for padding; optional, default is space

Response:

The padded string

Examples:

Right padding

Pads a string by inserting characters on the right side.

Endpoint:

GET https://api.clsr.net/padding/v1/right

GET parameters:

  • str: string – string to pad
  • len: integer – requested padded minimum string length, maximum value 16384
  • ch: character – a single character to be used for padding; optional, default is space

Response:

The padded string

Examples: