Expr.str.len_chars
methodView source ↗
def len_chars() -> Expr
Categories: string
Return number of chars (not bytes) of a string.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a").str.len_chars().alias("len_chars"))
>>>
┌──────┬────────────┐
│ a ┆ to_decimal │
│ --- ┆ --- │
│ str ┆ u32 │
╞══════╪════════════╡
│ ab ┆ 2 │
│ 再 ┆ 3 │
│ null ┆ null │
└──────┴────────────┘