Skip to content

LazyColumn.str.lstrip

lstrip

lstrip() -> LazyColumn

Strips whitespace from the left (leading side) of the string.

Returns:

Name Type Description
LazyColumn LazyColumn

A new LazyColumn with leading whitespace removed.

Examples:

print(df.head())
#    col1 my_string_column
# 0     1         "   abc"
# 1     2         "  def "
# 2     3          None
# 3     4        "  xyz   "
# 4     5        " hello  "

df["my_string_column"].str.lstrip()
# ["abc", "def ", None, "xyz   ", "hello  "]