What's the shortest way to do this in Python?
string = " xyz"
must return index = 3
>>> s = " xyz"
>>> len(s) - len(s.lstrip())
3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With