padString
Last updated
Generates a padded text. A padded text has additional characters added to either its beginning, end, or both sides to achieve a desired length or formatting.
string
The value to be padded.
String/Text
-
-
Yes
len
The length of the new padded text.
Number
0
-
Yes
type
The location of the 'string' within the new padded text.
String/Text
right
right, left, center
Yes
char
The value to use as padding.
String/Text
' '
-
No
Returns the padded value.
String/Text
N/A
Coming soon.
The user wants to add padding to a string with maximum length of 10, with the original string at the center.
Call the function console. Call the function padString inside the value parameter of the console function.
string: AB
len: 10
type: center
char: 1


There are 4 characters '1' added on both the left & right side of "AB", making the total length of the string 10.
Last updated