Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_lists
pad/4
Description
pad/4 is an Erlang function exported by "age_lists" module.
Pad a list to a certain length.
References
None
Parameters
Name
Type
Input
list() | string()
Input list of terms or byte sequence.
Length
integer()
Padding
integer() | string() | atom()
Optional padding value. Defaults to 32 (code of string space).
left | right
Optional padding type. Defaults to right.
Result
Value or Type
-
Code Sample
> age_lists:pad("The quick brown fox", 30). "The quick brown fox " > age_lists:pad("The quick brown fox", 30, 32, left). " The quick brown fox" > age_lists:pad([1,2,3,4], 10, 0, left). [0,0,0,0,0,0,1,2,3,4]