polars.internals.series.string.StringNameSpace.rjust#

StringNameSpace.rjust(width: int, fillchar: str = ' ') Series[source]#

Return the string right justified in a string of length width.

Padding is done using the specified fillchar. The original string is returned if width is less than or equal to len(s).

Parameters:
width

Justify right to this length.

fillchar

Fill with this ASCII character.

Examples

>>> s = pl.Series("a", ["cow", "monkey", None, "hippopotamus"])
>>> s.str.rjust(8, "*")
shape: (4,)
Series: 'a' [str]
[
    "*****cow"
    "**monkey"
    null
    "hippopotamus"
]