String Formatting

Ceren Susuz
Mar 7, 2023

--

There are some optional parameters that you can supply as part of the string to control the formatting.

The alignment value can be either a positive or negative number and is used to determine the character width of the field when the data is formatted.

If the number is positive, then the filed is right aligned. And if it’s negative, then the filed is left aligned.

Spacing and Alignment: Indexes

Spacing and Aligment: Interpolation

the same result:

--

--

Ceren Susuz
Ceren Susuz

Written by Ceren Susuz

Software Developer at EMakina an EPAM Company

No responses yet