std-lpad, std-rpad


Synopsis

(std-lpad <str> <len>)

(std-rpad <str> <len>)

Description

They justify a string to the left or right, so that the resulting string is exactly len characters long.

std-lpad adds spaces at the end until the the string has a length of len.

std-rpad adds spaces at the beginning until the the string has a length of len.

It is the same as the IntelliCAD ilisp function LPAD and RPAD

Examples

(std-lpad (rtos 1.0) 6)  => "1.0   "
(std-rpad (rtos 1.0) 6)  => "   1.0"

Arguments

str: a string.

len: a positive integer number.

Return Value

A string.

Side Effects

None.

Module

(std-require 'STDSTR)

Defined in STDSTR