walterbyrd wrote: > The strings start with whitespace, and have a '*' or an alphanumeric > character. I need to know how many whitespace characters exist at the > beginning of the string.
You really need to stop posting the same message multiple times.
A possible answer using regular expressions:
>>> import re
>>> whitespace_matcher = re.compile(r'^\s+')
>>> match = whitespace_matcher.search(' abc def ghi')
>>> len(match.group())
8
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
