pyspark.pandas.Series.str.lstrip#

str.lstrip(to_strip=None)#

Remove leading characters.

Strip whitespaces (including newlines) or a set of specified characters from each string in the Series/Index from left side. Equivalent to str.lstrip().

Parameters
to_stripstr

Specifying the set of characters to be removed. All combinations of this set of characters will be stripped. If None then whitespaces are removed.

Returns
Series of object

Examples

>>> s = ps.Series(['1. Ant.', '2. Bee!\t', None])
>>> s
0      1. Ant.
1    2. Bee!\t
2         None
dtype: object
>>> s.str.lstrip('12.')
0       Ant.
1     Bee!\t
2       None
dtype: object