Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 411 Bytes

how-to-left-trim-a-string.md

File metadata and controls

25 lines (19 loc) · 411 Bytes

How to left trim a string

" text ".lstrip()
  • " text " - example string to trim whitespaces
  • .lstrip() - will trim whitespaces from left side of the string

group: trim

Example:

str = " text "
trimmed = str.lstrip()
print(f'Original: "{str}", trimmed: "{trimmed}"')
Original: " text ", trimmed: "text "

Additional keywords

  • strip
  • remove whitespaces