polars.Series.str.rjust#
- Series.str.rjust(width: int, fill_char: str = ' ') Series [source]#
Return the string right justified in a string of length
width
.Padding is done using the specified
fill_char
. The original string is returned ifwidth
is less than or equal tolen(s)
.- Parameters:
- width
Justify right to this length.
- fill_char
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" ]