I'm trying to parse a text file, and am using almost the same line of code in two places. Both are essentially the following:
for line in scratch:
line = line.lstrip(u' ¶.1234567890')
The version where this works is reading from a .txt file, and the version where it doesn't is reading from a block of unicode. Anyone have any idea why it doesn't work on the text?
EDIT: To clarify, here's what I mean.
Working:
text = u'¶3. Foo Bar\n¶4. Foo Bar'
for line in text:
line = line.lstrip(u' ¶.1234567890')
print (text)
*Foo Bar
Foo Bar*
Not working:
text = u'¶3. Foo Bar\n¶4. Foo Bar'
for line in text:
line = line.lstrip(u' ¶.1234567890')
print (text)
¶3. Foo Bar
¶4. Foo Bar