Fwd: Text Strip() now working constantly.

George Shen gjshen at gmail.com
Sat Jan 27 12:25:35 EST 2018


Hi Python Group,

I am not sure if I am doing this correctly however, I believe I found a bug
that involves the striping of a text string.

I have attached a JPG that clearly illustrate the issue.

I am currently using 2.7.13

In short:
Given a string.
'cm_text.data'
if you try and strip '.data'
the return string will be
'cm_tex'
which drops the last 't'
however, given other text.
'om_ol.data'
the same strip '.data' will return
'om_ol' which is correct!

As for a work around right now I am doing the following.
string_abc = 'some_text.data'
string_next = string_abc.strip('data')
string_final = string_next.strip('.')

Please see the JPG.

Sorry if this has been filed before, if I have filed this incorrectly could
you please provide me a better avenue for future reference.

Regards,
-George J Shen



More information about the Python-list mailing list