polars.internals.series.string.StringNameSpace.lengths#

StringNameSpace.lengths() Series[source]#

Get length of the string values in the Series.

Returns:
Series[u32]

Examples

>>> s = pl.Series(["foo", None, "hello", "world"])
>>> s.str.lengths()
shape: (4,)
Series: '' [u32]
[
    3
    null
    5
    5
]