tabsdata.tableframe.expr.string.ExprStringNameSpace.len_bytes#

ExprStringNameSpace.len_bytes() Expr[source]#

Return number of bytes (not chars) of a string.

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a").str.len_bytes().alias("len_bytes"))
>>>
┌──────┬────────────┐
│ a    ┆ to_decimal │
│ ---  ┆ ---        │
│ str  ┆ u32        │
╞══════╪════════════╡
│ ab   ┆ 2          │
│ 再   ┆ 3          │
│ null ┆ null       │
└──────┴────────────┘