If I have a string for a file name such that I want to find the number
of characters to the left of the dot, how can that be done?

I did it this way:
x = "text12345.txt"
dot = x.find('.')
print dot

Was curious to see what method others would use - helps me learn.  I
guess I was most curious to see if it could be done in one line.

And, how would a char count be done with no dot -- like if the string
were "textstringwithoutdot" or "no dot in text string"?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to