How to remove leading whitespaces from a string in the Python?
1 Answer
Relevance
- brilliant_movesLv 71 month ago
Hi, jhon.
You would use the string.lstrip() function. Here's an example:
a_string = " hello"
print (a_string.lstrip())
Still have questions? Get answers by asking now.