Skip to main content
Version: 1.8.0

Expr.str.pad_end

def pad_end(length: int, fill_char: str = ' ') -> Expr

Categories: string

Pad string values at the end to the given length using the given fill character.

Parameters

parameter
length

The length to end pad the string to.

parameter
fill_char

The character to use for padding.

Examples

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a").str.pad_end(6, "-").alias("pad_end"))
>>>
┌────────┬─────────┐
│ a ┆ pad_end │
------
strstr
╞════════╪═════════╡
│ abc ┆ abc---
defdef
│ null ┆ null │
└────────┴─────────┘