Skip to main content
Version: 1.9.0

Expr.str.pad_start

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

Categories: string

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

Parameters

parameter
length

The length to front 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_start(6, "-").alias("pad_start"))
>>>
┌────────┬───────────┐
│ a ┆ pad_start │
------
strstr
╞════════╪═══════════╡
│ abc ┆ ---abc │
defdef
│ null ┆ null │
└────────┴───────────┘