Strip whitespace from the left side of a UTF-8 string.
Returns:
| Name | Type | Description |
Expression | Expression | a String expression which is self with leading whitespace stripped |
Examples:
| >>> import daft
>>> from daft.functions import lstrip
>>> df = daft.from_pydict({"x": ["foo", "bar", " baz"]})
>>> df = df.select(lstrip(df["x"]))
>>> df.show()
|
╭────────╮
│ x │
│ --- │
│ String │
╞════════╡
│ foo │
├╌╌╌╌╌╌╌╌┤
│ bar │
├╌╌╌╌╌╌╌╌┤
│ baz │
╰────────╯
(Showing first 3 of 3 rows)
Source code in daft/functions/str.py
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522 | def lstrip(expr: Expression) -> Expression:
"""Strip whitespace from the left side of a UTF-8 string.
Returns:
Expression: a String expression which is `self` with leading whitespace stripped
Examples:
>>> import daft
>>> from daft.functions import lstrip
>>> df = daft.from_pydict({"x": ["foo", "bar", " baz"]})
>>> df = df.select(lstrip(df["x"]))
>>> df.show()
╭────────╮
│ x │
│ --- │
│ String │
╞════════╡
│ foo │
├╌╌╌╌╌╌╌╌┤
│ bar │
├╌╌╌╌╌╌╌╌┤
│ baz │
╰────────╯
<BLANKLINE>
(Showing first 3 of 3 rows)
"""
return Expression._call_builtin_scalar_fn("lstrip", expr)
|